diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cfgfiles.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index f1e30b8b..a4d272bf 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -310,40 +310,32 @@ get_reg_str (const char *sub, const char *name, char *out, DWORD len) return FALSE; } +#endif char * get_xdir (void) { if (!xdir) { - char out[256]; - - if (portable_mode () || !get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", out, sizeof (out))) - { - xdir = g_strdup (".\\config"); - } - else - { - xdir = g_strdup_printf ("%s\\" "HexChat", out); - } - } - - return xdir; -} +#ifdef WIN32 + char out[256]; + if (portable_mode () || !get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", out, sizeof (out))) + { + xdir = g_strdup (".\\config"); + } + else + { + xdir = g_strdup_printf ("%s\\" "HexChat", out); + } #else - -char * -get_xdir (void) -{ - if (!xdir) xdir = g_strdup_printf ("%s/.config/" HEXCHAT_DIR, g_get_home_dir ()); +#endif + } return xdir; } -#endif /* !WIN32 */ - static void check_prefs_dir (void) { |