# HG changeset patch
# User John "Elwin" Edwards
# Date 1421433750 18000
# Node ID d10fc4a065ac7e84ca38edf2bd2b27cef07db59f
# Parent  8dd4b06a9155dd18a585580e0e9da0f7d51ae1cb
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.

diff -r 8dd4b06a9155 -r d10fc4a065ac rogue5/state.c
--- 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);