]> granicus.if.org Git - nethack/commitdiff
avoid panic save panic if external compress fails
authorPatR <rankin@nethack.org>
Sun, 22 Nov 2015 16:26:12 +0000 (08:26 -0800)
committerPatR <rankin@nethack.org>
Sun, 22 Nov 2015 16:26:12 +0000 (08:26 -0800)
On OSX 10.5, save file compression and uncompression fail when I run
under debugger control (for gdb, at least; I don't know why).  I used
'#panic' to try something out.  panic() calls exit_nhwindows(), then
after some messages calls dosave0().  Saving calls docompress_file()
and when that fails on tty it tries to call clear_nhwindow(WIN_MESSAGE)
but WIN_MESSAGE has been torn down already, leading to a nested panic().
Avoid the call to clear_nhwindow() if windows aren't up.

src/files.c

index f257046f653bac87f017ab7f5050a34828db9c54..c094069334aa799e2435c147ef4b6ab8881cc17c 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 files.c $NHDT-Date: 1447653425 2015/11/16 05:57:05 $  $NHDT-Branch: master $:$NHDT-Revision: 1.187 $ */
+/* NetHack 3.6 files.c $NHDT-Date: 1448209568 2015/11/22 16:26:08 $  $NHDT-Branch: master $:$NHDT-Revision: 1.188 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1353,7 +1353,7 @@ boolean uncomp;
          * messages are being written on top of the screen, but at least
          * the user can read them.
          */
-        if (istty) {
+        if (istty && iflags.window_inited) {
             clear_nhwindow(WIN_MESSAGE);
             more();
             /* No way to know if this is feasible */