# HG changeset patch # User Matti Hamalainen # Date 1577279927 -7200 # Node ID b5d5d37bbc644549a261357e8c459587a880d91e # Parent 6fa9c36d0634c71b581154ba450d1ea8550a775a Use th_get_home_dir(). diff -r 6fa9c36d0634 -r b5d5d37bbc64 main.c --- a/main.c Wed Dec 25 11:05:31 2019 +0200 +++ b/main.c Wed Dec 25 15:18:47 2019 +0200 @@ -2031,16 +2031,13 @@ // Get home directory path { + setHomeDir = th_get_home_dir(); + #if defined(TH_PLAT_WINDOWS) - char tmpPath[MAX_PATH]; - if (SHGetFolderPath(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, tmpPath) == S_OK) - setHomeDir = th_strdup(tmpPath); - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); setConfigDir = th_strdup(setHomeDir); #elif defined(USE_XDG) const char *xdgConfigDir = getenv("XDG_CONFIG_HOME"); - setHomeDir = th_strdup(getenv("HOME")); // If XDG is enabled, try the environment variable first if (xdgConfigDir != NULL && strcmp(xdgConfigDir, "")) @@ -2049,7 +2046,6 @@ // Nope, try the obvious alternative setConfigDir = th_strdup_printf("%s/.config/%s/", setHomeDir, SET_XDG_CONFIG_DIR); #else - setHomeDir = th_strdup(getenv("HOME")); setConfigDir = th_strdup(setHomeDir); #endif }