mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-26 11:12:19 -05:00
Use a full path to configdir when using portable mode
This avoids the issue of plugins changing paths on us
This commit is contained in:
parent
a1c9294b89
commit
aadee8afba
@ -332,6 +332,18 @@ get_xdir (void)
|
|||||||
|
|
||||||
if (portable_mode () || !get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", out, sizeof (out)))
|
if (portable_mode () || !get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", out, sizeof (out)))
|
||||||
{
|
{
|
||||||
|
char *path;
|
||||||
|
char file[MAX_PATH];
|
||||||
|
HMODULE hModule;
|
||||||
|
|
||||||
|
hModule = GetModuleHandle (NULL);
|
||||||
|
if (GetModuleFileName (hModule, file, sizeof(file)))
|
||||||
|
{
|
||||||
|
path = g_path_get_dirname (file);
|
||||||
|
xdir = g_build_filename (path, "config", NULL);
|
||||||
|
g_free (path);
|
||||||
|
}
|
||||||
|
else
|
||||||
xdir = g_strdup (".\\config");
|
xdir = g_strdup (".\\config");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user