-
Notifications
You must be signed in to change notification settings - Fork 0
/
hcl-redirect_user_data.patch
57 lines (57 loc) · 1.55 KB
/
hcl-redirect_user_data.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff --git a/src/game.c b/src/game.c
index 89df254..65e1f68 100644
--- a/src/game.c
+++ b/src/game.c
@@ -258,7 +258,7 @@ void game()
#elif defined(EMSCRIPTEN)
const char* home = "hcl_data/";
#else
- const char* home = getenv("HOME");
+ const char* home = getenv("XDG_DATA_HOME");
#endif
if(home)
{
diff --git a/src/ini.c b/src/ini.c
index 566df8c..9e2094b 100644
--- a/src/ini.c
+++ b/src/ini.c
@@ -32,7 +32,7 @@ void iniInit()
#elif defined(EMSCRIPTEN)
strcpy(fullPath, "hcl_data/");
#else
- strcpy(fullPath, getenv("HOME"));
+ strcpy(fullPath, getenv("XDG_DATA_HOME"));
strcat(fullPath, "/.hydracastlelabyrinth/");
#endif
#elif defined(_3DS)
@@ -68,7 +68,7 @@ void saveSettings()
#elif defined(EMSCRIPTEN)
strcpy(fullPath, "hcl_data/");
#else
- strcpy(fullPath, getenv("HOME"));
+ strcpy(fullPath, getenv("XDG_DATA_HOME"));
strcat(fullPath, "/.hydracastlelabyrinth/");
#endif
#elif defined(_3DS)
@@ -172,7 +172,7 @@ void loadSettings()
#elif defined(EMSCRIPTEN)
strcpy(fullPath, "hcl_data/");
#else
- strcpy(fullPath, getenv("HOME"));
+ strcpy(fullPath, getenv("XDG_DATA_HOME"));
strcat(fullPath, "/.hydracastlelabyrinth/");
#endif
#elif defined(_3DS)
diff --git a/src/main.c b/src/main.c
index 4095b2a..643c665 100644
--- a/src/main.c
+++ b/src/main.c
@@ -38,7 +38,7 @@ void createSaveLocations()
#elif defined(EMSCRIPTEN)
strcpy(buff, "hcl_data");
#else
- strcpy(buff, getenv("HOME"));
+ strcpy(buff, getenv("XDG_DATA_HOME"));
strcat(buff, "/.hydracastlelabyrinth");
#endif
// if exist first?