changeset 124:d10fc4a065ac

rogue5: ignore the file name stored in the save file. state.c had put file_name into the save file. The saved value was used to overwrite file_name on restore. If the save file had been renamed, unlink(file_name) would then fail, because file_name held the old name. To avoid breaking savefile compatibility, file_name is still saved, but it is read back into a temporary buffer and then ignored. I thought I fixed this already.
author John "Elwin" Edwards
date Fri, 16 Jan 2015 13:42:30 -0500
parents 8dd4b06a9155
children adfa37e67084 e6179860cb76
files rogue5/state.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rogue5/state.c	Fri May 09 07:52:02 2014 -0700
+++ b/rogue5/state.c	Fri Jan 16 13:42:30 2015 -0500
@@ -1389,6 +1389,7 @@
 int
 rs_restore_file(FILE *savef)
 {
+    char fake_file_name[MAXSTR];
     THING *mitem;
     encclearerr();
 
@@ -1402,7 +1403,7 @@
     rs_read_int(savef, &terse);
     rs_read_int(savef, &tombstone);
     rs_read_ints(savef, pack_used, 26);
-    rs_read_chars(savef, file_name, MAXSTR);
+    rs_read_chars(savef, fake_file_name, MAXSTR);
     rs_read_chars(savef, huh, MAXSTR);
     rs_read_potions(savef);
     rs_read_rings(savef);