]> granicus.if.org Git - nethack/commitdiff
U393 - unix hangups in endgame
authorcohrs <cohrs>
Sun, 8 Jun 2003 18:31:57 +0000 (18:31 +0000)
committercohrs <cohrs>
Sun, 8 Jun 2003 18:31:57 +0000 (18:31 +0000)
Unix code does not always go thru hangup() when EOF is encountered.
There is a similar end_of_input() that is sometimes called instead, which
was missing a test of program_state.something_worth_saving.

doc/fixes34.2
src/cmd.c

index 7d121dadfab13d4c1dd9d7ed1d81c927b7cecaab..89e3c53136a77c12dd6771bc3a9a84bc720bdb41 100644 (file)
@@ -108,6 +108,7 @@ win32: some code in files.c was incorrectly assuming that a file
 tiles: high priest tile had a couple bad pixels
 tiles: bad pixels in Croesus and Yeenoghu tiles
 FreeBSD: incorrect srandom declaration
+unix: don't autosave if hangup occurs after game is over
 
 
 General New Features
index 9309ab474b8cc2787c855297f2e344a36388ecae..dfcd578322c4bd933ad959dd3c1d7b774dd3daa4 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -2336,7 +2336,7 @@ end_of_input()
 {
        exit_nhwindows("End of input?");
 #ifndef NOSAVEONHANGUP
-       if (!program_state.done_hup++)
+       if (!program_state.done_hup++ && program_state.something_worth_saving)
            (void) dosave0();
 #endif
        clearlocks();