summary refs log tree commit diff stats
path: root/src/common/cfgfiles.c
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-11-04 21:40:59 +0100
committerBerke Viktor <bviktor@hexchat.org>2012-11-04 21:40:59 +0100
commitd0b5d53f92027863292116181d75fd0a68075003 (patch)
treed4b9386cbec5d08013cecce72b47b85d4c2b2e5b /src/common/cfgfiles.c
parent5c9283fc688004d3b519c8410141475ab3928a28 (diff)
Some more platform unification
Diffstat (limited to 'src/common/cfgfiles.c')
-rw-r--r--src/common/cfgfiles.c34
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)
 {