diff options
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/prefs.c | 8 | ||||
-rw-r--r-- | libsylph/utils.c | 15 |
2 files changed, 19 insertions, 4 deletions
diff --git a/libsylph/prefs.c b/libsylph/prefs.c index 190f5837..030cc746 100644 --- a/libsylph/prefs.c +++ b/libsylph/prefs.c @@ -425,6 +425,9 @@ void prefs_set_default(PrefParam *param) gchar *tmp = NULL; envstr = g_getenv(param[i].defval + 4); +#ifdef G_OS_WIN32 + tmp = g_strdup(envstr); +#else if (envstr) { tmp = conv_codeset_strdup (envstr, @@ -435,10 +438,15 @@ void prefs_set_default(PrefParam *param) tmp = g_strdup(envstr); } } +#endif *((gchar **)param[i].data) = tmp; } else if (param[i].defval[0] == '~') *((gchar **)param[i].data) = +#ifdef G_OS_WIN32 + g_strconcat(get_rc_dir(), +#else g_strconcat(get_home_dir(), +#endif param[i].defval + 1, NULL); else if (param[i].defval[0] != '\0') diff --git a/libsylph/utils.c b/libsylph/utils.c index 1058b83e..c8e3395b 100644 --- a/libsylph/utils.c +++ b/libsylph/utils.c @@ -1648,15 +1648,22 @@ const gchar *get_rc_dir(void) { static gchar *rc_dir = NULL; - if (!rc_dir) + if (!rc_dir) { #ifdef G_OS_WIN32 - rc_dir = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, - "Application Data", G_DIR_SEPARATOR_S, - RC_DIR, NULL); + const gchar *appdata; + + appdata = g_getenv("APPDATA"); + if (appdata) + rc_dir = g_strconcat(appdata, G_DIR_SEPARATOR_S, + RC_DIR, NULL); + else + rc_dir = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, + RC_DIR, NULL); #else rc_dir = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, RC_DIR, NULL); #endif + } return rc_dir; } |