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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
--- src/savegame.c.orig 2004-06-22 01:11:47.000000000 -0700
+++ src/savegame.c 2004-06-22 01:14:42.000000000 -0700
@@ -21,23 +21,24 @@
char *partySavFilename() {
char *fname;
-#if defined(MACOSX)
char *home;
home = getenv("HOME");
if (home && home[0]) {
fname = (char *) malloc(strlen(home) +
+#if defined(MACOSX)
strlen(MACOSX_USER_FILES_PATH) +
+#endif
+strlen("/.u4/") +
strlen(PARTY_SAV_BASE_FILENAME) + 2);
strcpy(fname, home);
+#if defined(MACOSX)
strcat(fname, MACOSX_USER_FILES_PATH);
- strcat(fname, "/");
+#endif
+ strcat(fname, "/.u4/");
strcat(fname, PARTY_SAV_BASE_FILENAME);
} else
fname = strdup(PARTY_SAV_BASE_FILENAME);
-#else
- fname = strdup(PARTY_SAV_BASE_FILENAME);
-#endif
return fname;
}
@@ -45,24 +45,24 @@
char *monstersSavFilename() {
char *fname;
-#if defined(MACOSX)
char *home;
home = getenv("HOME");
if (home && home[0]) {
fname = (char *) malloc(strlen(home) +
+#if defined(MACOSX)
strlen(MACOSX_USER_FILES_PATH) +
+#endif
+strlen("/.u4/") +
strlen(MONSTERS_SAV_BASE_FILENAME) + 2);
strcpy(fname, home);
+#if defined(MACOSX)
strcat(fname, MACOSX_USER_FILES_PATH);
- strcat(fname, "/");
+#endif
+ strcat(fname, "/.u4/");
strcat(fname, MONSTERS_SAV_BASE_FILENAME);
} else
fname = strdup(MONSTERS_SAV_BASE_FILENAME);
-#else
- fname = strdup(MONSTERS_SAV_BASE_FILENAME);
-#endif
-
return fname;
}
--- src/u4.c.orig 2004-06-22 01:28:38.000000000 -0700
+++ src/u4.c 2004-06-22 01:30:30.000000000 -0700
@@ -38,6 +38,10 @@
osxInit(argv[0]);
#endif
+ if (getenv("HOME")) {
+ chdir(getenv("HOME"));
+ mkdir(".u4", 0777);
+ }
settingsRead();
for (i = 1; i < (unsigned int)argc; i++) {
|