diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-06 08:09:26 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-06 08:09:26 +0000 |
commit | 69501c1a570997de5597a7d297cc8167b986812c (patch) | |
tree | b87d0228b213d6b929cb8c483a998ef120463c14 /libsylph/utils.c | |
parent | 8f444056099876aa36382824e637ad2084dc9c4c (diff) |
win32: environmental variable fix.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@624 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/utils.c')
-rw-r--r-- | libsylph/utils.c | 15 |
1 files changed, 11 insertions, 4 deletions
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; } |