変愚蛮怒のメインリポジトリです
Revision | 659237239ed164db053147b4b19c48809c6560ea (tree) |
---|---|
Zeit | 2020-11-22 14:00:09 |
Autor | iks <iks@user...> |
Commiter | iks |
[Fix] コミット d2d41298 で消えていた旧ファイルの変更点を新ファイルに適用。 / Applicate defferences of commit-id d2d41298 on new files instead of already removed files.
@@ -3447,7 +3447,7 @@ static void init_stuff(void) | ||
3447 | 3447 | |
3448 | 3448 | strcpy(path + i + 1, "lib\\"); |
3449 | 3449 | validate_dir(path, TRUE); |
3450 | - init_file_paths(path); | |
3450 | + init_file_paths(path, path); | |
3451 | 3451 | validate_dir(ANGBAND_DIR_APEX, FALSE); |
3452 | 3452 | validate_dir(ANGBAND_DIR_BONE, FALSE); |
3453 | 3453 | if (!check_dir(ANGBAND_DIR_EDIT)) { |
@@ -36,9 +36,10 @@ | ||
36 | 36 | * @param path パス保管先の文字列 |
37 | 37 | * @return なし |
38 | 38 | */ |
39 | -void init_file_paths(char *path) | |
39 | +void init_file_paths(char *libpath, char *varpath) | |
40 | 40 | { |
41 | - char *tail; | |
41 | + char *libtail, *vartail; | |
42 | + | |
42 | 43 | #ifdef PRIVATE_USER_PATH |
43 | 44 | char buf[1024]; |
44 | 45 | #endif |
@@ -55,37 +56,39 @@ void init_file_paths(char *path) | ||
55 | 56 | string_free(ANGBAND_DIR_USER); |
56 | 57 | string_free(ANGBAND_DIR_XTRA); |
57 | 58 | |
58 | - ANGBAND_DIR = string_make(path); | |
59 | - tail = path + strlen(path); | |
60 | - strcpy(tail, "apex"); | |
61 | - ANGBAND_DIR_APEX = string_make(path); | |
62 | - strcpy(tail, "bone"); | |
63 | - ANGBAND_DIR_BONE = string_make(path); | |
64 | - strcpy(tail, "data"); | |
65 | - ANGBAND_DIR_DATA = string_make(path); | |
66 | - strcpy(tail, "edit"); | |
67 | - ANGBAND_DIR_EDIT = string_make(path); | |
68 | - strcpy(tail, "script"); | |
69 | - ANGBAND_DIR_SCRIPT = string_make(path); | |
70 | - strcpy(tail, "file"); | |
71 | - ANGBAND_DIR_FILE = string_make(path); | |
72 | - strcpy(tail, "help"); | |
73 | - ANGBAND_DIR_HELP = string_make(path); | |
74 | - strcpy(tail, "info"); | |
75 | - ANGBAND_DIR_INFO = string_make(path); | |
76 | - strcpy(tail, "pref"); | |
77 | - ANGBAND_DIR_PREF = string_make(path); | |
78 | - strcpy(tail, "save"); | |
79 | - ANGBAND_DIR_SAVE = string_make(path); | |
59 | + | |
60 | + ANGBAND_DIR = string_make(libpath); | |
61 | + libtail = libpath + strlen(libpath); | |
62 | + vartail = varpath + strlen(varpath); | |
63 | + strcpy(vartail, "apex"); | |
64 | + ANGBAND_DIR_APEX = string_make(varpath); | |
65 | + strcpy(vartail, "bone"); | |
66 | + ANGBAND_DIR_BONE = string_make(varpath); | |
67 | + strcpy(vartail, "data"); | |
68 | + ANGBAND_DIR_DATA = string_make(varpath); | |
69 | + strcpy(libtail, "edit"); | |
70 | + ANGBAND_DIR_EDIT = string_make(libpath); | |
71 | + strcpy(libtail, "script"); | |
72 | + ANGBAND_DIR_SCRIPT = string_make(libpath); | |
73 | + strcpy(libtail, "file"); | |
74 | + ANGBAND_DIR_FILE = string_make(libpath); | |
75 | + strcpy(libtail, "help"); | |
76 | + ANGBAND_DIR_HELP = string_make(libpath); | |
77 | + strcpy(libtail, "info"); | |
78 | + ANGBAND_DIR_INFO = string_make(libpath); | |
79 | + strcpy(libtail, "pref"); | |
80 | + ANGBAND_DIR_PREF = string_make(libpath); | |
81 | + strcpy(vartail, "save"); | |
82 | + ANGBAND_DIR_SAVE = string_make(varpath); | |
80 | 83 | #ifdef PRIVATE_USER_PATH |
81 | 84 | path_build(buf, sizeof(buf), PRIVATE_USER_PATH, VERSION_NAME); |
82 | 85 | ANGBAND_DIR_USER = string_make(buf); |
83 | 86 | #else |
84 | - strcpy(tail, "user"); | |
85 | - ANGBAND_DIR_USER = string_make(path); | |
87 | + strcpy(vartail, "user"); | |
88 | + ANGBAND_DIR_USER = string_make(varpath); | |
86 | 89 | #endif |
87 | - strcpy(tail, "xtra"); | |
88 | - ANGBAND_DIR_XTRA = string_make(path); | |
90 | + strcpy(libtail, "xtra"); | |
91 | + ANGBAND_DIR_XTRA = string_make(libpath); | |
89 | 92 | } |
90 | 93 | |
91 | 94 | /*! |
@@ -16,6 +16,6 @@ | ||
16 | 16 | |
17 | 17 | typedef void (*process_autopick_file_command_pf)(char *); |
18 | 18 | void init_angband(player_type *player_ptr, process_autopick_file_command_pf process_autopick_file_command); |
19 | -void init_file_paths(char *path); | |
19 | +void init_file_paths(char *path, char *varpath); | |
20 | 20 | |
21 | 21 | #endif /* INCLUDED_INIT_H */ |
@@ -181,8 +181,18 @@ | ||
181 | 181 | * actual location of the "lib" folder, for example, "/tmp/angband/lib/" |
182 | 182 | * or "/usr/games/lib/angband/", or "/pkg/angband/lib". |
183 | 183 | */ |
184 | -#ifndef DEFAULT_PATH | |
185 | -# define DEFAULT_PATH "./lib/" | |
184 | +#ifndef DEFAULT_LIB_PATH | |
185 | +#define DEFAULT_LIB_PATH "./lib/" | |
186 | +#endif | |
187 | + | |
188 | +/* | |
189 | + * OPTION: Set the "default" path to the angband "var" directory. | |
190 | + * | |
191 | + * This is like DEFAULT_LIB_PATH, but is for files that will be | |
192 | + * modified after installation. | |
193 | + */ | |
194 | +#ifndef DEFAULT_VAR_PATH | |
195 | +#define DEFAULT_VAR_PATH DEFAULT_LIB_PATH | |
186 | 196 | #endif |
187 | 197 | |
188 | 198 | /* |