summary refs log tree commit diff stats
path: root/src/common/cfgfiles.c
diff options
context:
space:
mode:
authorTingPing <tingping@fedoraproject.org>2014-08-23 12:45:02 -0400
committerTingPing <tingping@fedoraproject.org>2014-08-23 12:45:02 -0400
commit9716185edf2fa2c3b0b9b9b453609522e8b91e61 (patch)
tree3fe55f5b904d08c637555480be562ed55e92fcd9 /src/common/cfgfiles.c
parenta38892ff3b75c411ba7917412f6861d420cf9ae1 (diff)
Use glib to get portable mode dir
This should fix any non-ascii paths
Diffstat (limited to 'src/common/cfgfiles.c')
-rw-r--r--src/common/cfgfiles.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 33d9a5d6..a8bd32f9 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -313,13 +313,10 @@ get_xdir (void)
 		if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_RoamingAppData, 0, NULL, &roaming_path_wide) != S_OK)
 		{
 			char *path;
-			char file[MAX_PATH];
-			HMODULE hModule;
-			
-			hModule = GetModuleHandle (NULL);
-			if (GetModuleFileName (hModule, file, sizeof(file)))
+
+			path = g_win32_get_package_installation_directory_of_module (NULL);
+			if (path)
 			{
-				path = g_path_get_dirname (file);
 				xdir = g_build_filename (path, "config", NULL);
 				g_free (path);
 			}