We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f850c0c commit 70f532dCopy full SHA for 70f532d
1 file changed
src/files.c
@@ -857,7 +857,16 @@ touch_whereis(void)
857
void
858
delete_whereis(void)
859
{
860
- write_whereis(FALSE);
+ if (program_state.something_worth_saving) {
861
+ /* if we have valid data to write, just write it but specify that the
862
+ * game isn't active ("playing=0") */
863
+ write_whereis(FALSE);
864
+ } else {
865
+ /* if data may be unavailable for writing, actually unlink the file */
866
+ if (strstr(whereis_file, "%n"))
867
+ set_whereisfile();
868
+ (void) unlink(whereis_file);
869
+ }
870
}
871
#endif /* WHEREIS_FILE */
872
0 commit comments