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.
This commit is contained in:
John "Elwin" Edwards 2015-01-16 13:42:30 -05:00
parent 832d685d60
commit 6af92da76a

View file

@ -1389,6 +1389,7 @@ rs_save_file(FILE *savef)
int
rs_restore_file(FILE *savef)
{
char fake_file_name[MAXSTR];
THING *mitem;
encclearerr();
@ -1402,7 +1403,7 @@ rs_restore_file(FILE *savef)
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);