diff --git a/src/cmd.c b/src/cmd.c index df96c79ff..3f47719ea 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -6317,7 +6317,8 @@ hangup( must continue running longer before attempting a hangup save. */ gp.program_state.done_hup++; /* defer hangup iff game appears to be in progress */ - if (gp.program_state.in_moveloop && gp.program_state.something_worth_saving) + if (gp.program_state.in_moveloop + && gp.program_state.something_worth_saving) return; #endif /* SAFERHANGUP */ end_of_input(); diff --git a/win/X11/winX.c b/win/X11/winX.c index 05d7c2ef9..9ee92a123 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -1515,8 +1515,11 @@ X11_error_handler(String str) { nhUse(str); hangup(1); - nh_terminate(EXIT_FAILURE); +#ifdef SAFERHANGUP /* keeps going after hangup() for '#if SAFERHANGUP' */ + end_of_input(); +#endif /*NOTREACHED*/ + nh_terminate(EXIT_FAILURE); } static int @@ -1524,6 +1527,10 @@ X11_io_error_handler(Display *display) { nhUse(display); hangup(1); +#ifdef SAFERHANGUP /* keeps going after hangup() for '#if SAFERHANGUP' */ + end_of_input(); +#endif + /*NOREACHED*/ /* but not declared NORETURN */ return 0; }