| Date: Tue, 1 Dec 2020 22:38:14 -0800
Use GLib to get app data directory
There is already a GLib function, g_get_user_config_dir(),
tto get the Windows per-user config directory, so use that.
Diffstat:
M src/winmain.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
--- |
| t@@ -30,7 +30,6 @@
#include
#include
#include
-#include
#include
#include
t@@ -110,13 +109,8 @@ gchar *appdata_path = NULL;
static void GetAppDataPath()
{
- char shfolder[MAX_PATH];
-
- if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA,
- NULL, 0, shfolder))) {
- appdata_path = g_strdup_printf("%s/dopewars", shfolder);
- mkdir(appdata_path);
- }
+ appdata_path = g_strdup_printf("%s/dopewars", g_get_user_config_dir());
+ mkdir(appdata_path);
}
static void LogFileStart() |