What happens
Starting NetHack with an existing saved game shows a garbled "Who are you?"
screen with a message like:
freopen of save/501player for compress failed; (2) No such file or directory
and the game usually crashes right after.
When
When the save directory (VAR_PLAYGROUND) is a different folder from the one
NetHack switches into at startup (HACKDIR). Packaged builds such as Homebrew
set these to different folders.
Cause
In src/files.c, plname_from_file() (un)compresses the save file using a
relative path, so it's looked up in the wrong folder. Everywhere else the
full path is built with fqname().
Possible Fix
Use fqname() for those two calls, like the rest of the save code:
nh_uncompress(fqname(gs.SAVEF, SAVEPREFIX, 0));
...
nh_compress(fqname(gs.SAVEF, SAVEPREFIX, 0));
What happens
Starting NetHack with an existing saved game shows a garbled "Who are you?"
screen with a message like:
and the game usually crashes right after.
When
When the save directory (
VAR_PLAYGROUND) is a different folder from the oneNetHack switches into at startup (
HACKDIR). Packaged builds such as Homebrewset these to different folders.
Cause
In
src/files.c,plname_from_file()(un)compresses the save file using arelative path, so it's looked up in the wrong folder. Everywhere else the
full path is built with
fqname().Possible Fix
Use
fqname()for those two calls, like the rest of the save code: