OSDN Git Service

Rerrange so default_savefile is set on non-Windows platforms.
authorEric Branlund <ebranlund@fastmail.com>
Fri, 5 Feb 2021 22:24:20 +0000 (14:24 -0800)
committerEric Branlund <ebranlund@fastmail.com>
Fri, 5 Feb 2021 22:24:20 +0000 (14:24 -0800)
src/main/angband-initializer.c

index 5870949..666562a 100644 (file)
@@ -101,13 +101,13 @@ void init_file_paths(char *libpath, char *varpath)
     strcpy(libtail, "xtra");
     ANGBAND_DIR_XTRA = string_make(libpath);
 
-#ifdef WINDOWS
     time_t now = time(NULL);
     struct tm *t = localtime(&now);
     char tmp[128];
     strftime(tmp, sizeof(tmp), "%Y-%m-%d-%H-%M-%S", t);
     path_build(debug_savefile, sizeof(debug_savefile), ANGBAND_DIR_DEBUG_SAVE, tmp);
 
+#ifdef WINDOWS
     struct _finddata_t c_file;
     intptr_t hFile;
     char log_file_expr[1024];
@@ -128,7 +128,6 @@ void init_file_paths(char *libpath, char *varpath)
         DIR *saves_dir = opendir(ANGBAND_DIR_DEBUG_SAVE);
 
         if (saves_dir) {
-            time_t now = time(NULL);
             struct dirent *next_entry;
 
             while ((next_entry = readdir(saves_dir))) {