• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision659237239ed164db053147b4b19c48809c6560ea (tree)
Zeit2020-11-22 14:00:09
Autoriks <iks@user...>
Commiteriks

Log Message

[Fix] コミット d2d41298 で消えていた旧ファイルの変更点を新ファイルに適用。 / Applicate defferences of commit-id d2d41298 on new files instead of already removed files.

Ändern Zusammenfassung

Diff

--- a/src/main-win.c
+++ b/src/main-win.c
@@ -3447,7 +3447,7 @@ static void init_stuff(void)
34473447
34483448 strcpy(path + i + 1, "lib\\");
34493449 validate_dir(path, TRUE);
3450- init_file_paths(path);
3450+ init_file_paths(path, path);
34513451 validate_dir(ANGBAND_DIR_APEX, FALSE);
34523452 validate_dir(ANGBAND_DIR_BONE, FALSE);
34533453 if (!check_dir(ANGBAND_DIR_EDIT)) {
--- a/src/main/angband-initializer.c
+++ b/src/main/angband-initializer.c
@@ -36,9 +36,10 @@
3636 * @param path パス保管先の文字列
3737 * @return なし
3838 */
39-void init_file_paths(char *path)
39+void init_file_paths(char *libpath, char *varpath)
4040 {
41- char *tail;
41+ char *libtail, *vartail;
42+
4243 #ifdef PRIVATE_USER_PATH
4344 char buf[1024];
4445 #endif
@@ -55,37 +56,39 @@ void init_file_paths(char *path)
5556 string_free(ANGBAND_DIR_USER);
5657 string_free(ANGBAND_DIR_XTRA);
5758
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);
8083 #ifdef PRIVATE_USER_PATH
8184 path_build(buf, sizeof(buf), PRIVATE_USER_PATH, VERSION_NAME);
8285 ANGBAND_DIR_USER = string_make(buf);
8386 #else
84- strcpy(tail, "user");
85- ANGBAND_DIR_USER = string_make(path);
87+ strcpy(vartail, "user");
88+ ANGBAND_DIR_USER = string_make(varpath);
8689 #endif
87- strcpy(tail, "xtra");
88- ANGBAND_DIR_XTRA = string_make(path);
90+ strcpy(libtail, "xtra");
91+ ANGBAND_DIR_XTRA = string_make(libpath);
8992 }
9093
9194 /*!
--- a/src/main/angband-initializer.h
+++ b/src/main/angband-initializer.h
@@ -16,6 +16,6 @@
1616
1717 typedef void (*process_autopick_file_command_pf)(char *);
1818 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);
2020
2121 #endif /* INCLUDED_INIT_H */
--- a/src/system/h-config.h
+++ b/src/system/h-config.h
@@ -181,8 +181,18 @@
181181 * actual location of the "lib" folder, for example, "/tmp/angband/lib/"
182182 * or "/usr/games/lib/angband/", or "/pkg/angband/lib".
183183 */
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
186196 #endif
187197
188198 /*
Show on old repository browser