diff --git a/src/cmd.c b/src/cmd.c index e123aeb86..adc81a50a 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2825,13 +2825,18 @@ void end_of_input() { # ifdef NOSAVEONHANGUP - program_state.something_worth_saving = 0; +# ifdef INSURANCE + if (flags.ins_chkpt && program_state.something_worth_saving) + program_statue.preserve_locks = 1; /* keep files for recovery */ +# endif + program_state.something_worth_saving = 0; /* don't save */ # endif + # ifndef SAFERHANGUP if (!program_state.done_hup++) # endif if (program_state.something_worth_saving) (void) dosave0(); - exit_nhwindows((char *)0); + if (iflags.window_inited) exit_nhwindows((char *)0); clearlocks(); terminate(EXIT_SUCCESS); /*NOTREACHED*/ /* not necessarily true for vms... */ diff --git a/sys/vms/vmstty.c b/sys/vms/vmstty.c index 8f54e3d85..c4b4aa009 100644 --- a/sys/vms/vmstty.c +++ b/sys/vms/vmstty.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)vmstty.c 3.5 2007/01/08 */ +/* SCCS Id: @(#)vmstty.c 3.5 2007/01/31 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ /* tty.c - (VMS) version */ @@ -375,8 +375,9 @@ void settty(s) const char *s; { - if (!bombing) end_screen(); - if (s) raw_print(s); + if (!bombing) end_screen(); + if (s) raw_print(s); + if (settty_needed) { disable_broadcast_trapping(); #if 0 /* let SMG's exit handler do the cleanup (as per doc) */ /* #ifndef USE_QIO_INPUT */ @@ -392,6 +393,7 @@ const char *s; setctty(); settty_needed = FALSE; + } } /* same as settty, with no clearing of the screen */ diff --git a/win/tty/getline.c b/win/tty/getline.c index 6987cd7c4..6eb8e028e 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)getline.c 3.5 2002/10/06 */ +/* SCCS Id: @(#)getline.c 3.5 2007/01/31 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -226,6 +226,9 @@ register const char *s; /* chars allowed besides return */ register int c, x = ttyDisplay ? (int) ttyDisplay->dismiss_more : '\n'; morc = 0; +#ifdef HANGUPHANDLING + if (program_state.done_hup) return; +#endif while((c = tty_nhgetch()) != '\n') { if(iflags.cbreak) {