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.
This commit is contained in:
PatR
2015-11-22 08:26:12 -08:00
parent 48745c8f67
commit f22c9c000a

View 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 */