# HG changeset patch # User Matti Hamalainen # Date 1556928023 -10800 # Node ID 4a3d561d5406482c7fd94de264b73e88a143b479 # Parent 58b744131b86186581098e6904dc920c33f88914 Return empty directory paths under Windows if we can't retrieve AppData directory in th_get_home_dir() and th_get_data_dir(). diff -r 58b744131b86 -r 4a3d561d5406 th_file.c --- a/th_file.c Tue Feb 19 09:49:41 2019 +0200 +++ b/th_file.c Sat May 04 03:00:23 2019 +0300 @@ -27,6 +27,9 @@ char tmpPath[MAX_PATH]; if (SHGetFolderPath(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, tmpPath) == S_OK) return th_strdup(tmpPath); + else + return th_strdup(""); + #elif defined(TH_PLAT_DOS) return th_strdup("C:\\"); #else @@ -41,6 +44,9 @@ char tmpPath[MAX_PATH]; if (SHGetFolderPath(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, tmpPath) == S_OK) return th_strdup(tmpPath); + else + return th_strdup(""); + #elif defined(TH_PLAT_DOS) return th_strdup("C:\\"); #else