From d0b5d53f92027863292116181d75fd0a68075003 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 4 Nov 2012 21:40:59 +0100 Subject: Some more platform unification --- src/common/cfgfiles.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'src/common') 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) { -- cgit 1.4.1