The wizard mode sequence
load bones? y, unlink bones? y, die, save bones? y
works, but
load bones? y, unlink bones? n, die, save bones? y, replace old bones? y
fails if/when external compression is in use. The file gets uncompressed
before being opened to check its existence, then immediately closed, and
re-compressed, changing the file's name, before the deletion attempt takes
place. Then delete_bonesfile() can't find it via the uncompressed name
and the bones saving code reports "cannot unlink old bones".
The code involved doesn't seem to have changed since the current cvs
repository was set up, so this bug has gone unnoticed for a long time.
There's no reason this fix shouldn't go into the branch too, other than the
fact that I don't have that checked out on this machine. If someone wants
to apply it there, be my guest (and move the fixes entry to fixes34.4).
underwater could put hero on top of the water after restore
items conferring life drain resistance were affected by drain life spell
'a'pply command could be used to recogniize undiscovered potions of oil
+fix replacing an existing bones file in wizard mode [load?y, unlink?n, die?y,
+ save?y, replace?y] for configurations using external file compression
Platform- and/or Interface-Specific Fixes
fd = open_bonesfile(&u.uz, &bonesid);
if (fd >= 0) {
(void) close(fd);
- compress_bonesfile();
#ifdef WIZARD
if (wizard) {
if (yn("Bones file already exists. Replace it?") == 'y') {
}
}
#endif
+ /* compression can change the file's name, so must
+ wait until after any attempt to delete this file */
+ compress_bonesfile();
return;
}