Explorar o código

Use LOCALAPPPATH instead of USERPROFILE on Windows

* Because _mkdir may create not writable directory in %USERPROFILE%
* Also do not try HOME before LOCALAPPPATH because it may be
set by Cygwin or MSYS

From Jerome Robert, thanks!
Samuel Thibault %!s(int64=9) %!d(string=hai) anos
pai
achega
10de788ee7
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      src/common/utils.c

+ 5 - 1
src/common/utils.c

@@ -341,10 +341,14 @@ char *_starpu_get_home_path(void)
 	char *path = starpu_getenv("XDG_CACHE_HOME");
 	if (!path)
 		path = starpu_getenv("STARPU_HOME");
+#ifdef _WIN32
 	if (!path)
-		path = starpu_getenv("HOME");
+		path = starpu_getenv("LOCALAPPDATA");
 	if (!path)
 		path = starpu_getenv("USERPROFILE");
+#endif
+	if (!path)
+		path = starpu_getenv("HOME");
 	if (!path)
 	{
 		static int warn;