diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 330967a..a9cb279 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -36,7 +36,7 @@
 #ifdef WIN32
 #define XCHAT_DIR "X-Chat 2"
 #else
-#define XCHAT_DIR ".xchat2"
+#define XCHAT_DIR "xchat2"
 #endif
 #define DEF_FONT "Monospace 9"
 
@@ -278,61 +278,15 @@ cfg_get_int (char *cfg, char *var)
 char *xdir_fs = NULL;	/* file system encoding */
 char *xdir_utf = NULL;	/* utf-8 encoding */
 
-#ifdef WIN32
-
-#include <windows.h>
-
-static gboolean
-get_reg_str (const char *sub, const char *name, char *out, DWORD len)
-{
-	HKEY hKey;
-	DWORD t;
-
-	if (RegOpenKeyEx (HKEY_CURRENT_USER, sub, 0, KEY_READ, &hKey) ==
-			ERROR_SUCCESS)
-	{
-		if (RegQueryValueEx (hKey, name, NULL, &t, out, &len) != ERROR_SUCCESS ||
-			 t != REG_SZ)
-		{
-			RegCloseKey (hKey);
-			return FALSE;
-		}
-		out[len-1] = 0;
-		RegCloseKey (hKey);
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
 char *
 get_xdir_fs (void)
 {
-	if (!xdir_fs)
-	{
-		char out[256];
+    if (!xdir_fs)
+        xdir_fs = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), XCHAT_DIR, NULL);
 
-		if (!get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\"
-				"Explorer\\Shell Folders", "AppData", out, sizeof (out)))
-			return "./config";
-		xdir_fs = g_strdup_printf ("%s\\" XCHAT_DIR, out);
-	}
 	return xdir_fs;
 }
 
-#else
-
-char *
-get_xdir_fs (void)
-{
-	if (!xdir_fs)
-		xdir_fs = g_strdup_printf ("%s/" XCHAT_DIR, g_get_home_dir ());
-
-	return xdir_fs;
-}
-
-#endif	/* !WIN32 */
-
 char *
 get_xdir_utf8 (void)
 {
