From 04d2329fed2d9d3edce5fb4f37b923e26d733c1e Mon Sep 17 00:00:00 2001 From: TingPing Date: Sat, 23 Aug 2014 12:45:02 -0400 Subject: [PATCH] Use glib to get portable mode dir This should fix any non-ascii paths --- src/common/cfgfiles.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 800fc1ca..1795437f 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); }