From: PatR Date: Sun, 22 Nov 2015 16:26:12 +0000 (-0800) Subject: avoid panic save panic if external compress fails X-Git-Tag: NetHack-3.6.0_RC01~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f22c9c000a0b57a636ad6489a9c3f416149a2e91;p=nethack avoid panic save panic if external compress fails 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. --- diff --git a/src/files.c b/src/files.c index f257046f6..c09406933 100644 --- a/src/files.c +++ b/src/files.c @@ -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 */