From 13b1aa6bc290a681990315f0bafe4d28ba1b5d4c Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 2 Feb 2007 02:45:37 +0000 Subject: [PATCH] hangup followup (trunk only) The hangup check added to xwaitforspace() (which gets tty user's response to --More-- and "Press Return to continue: ") wouldn't be good enough if hangup occurred while that routine's input loop was executing. --- win/tty/getline.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/win/tty/getline.c b/win/tty/getline.c index 6eb8e028e..6401ecd3a 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -226,14 +226,16 @@ register const char *s; /* chars allowed besides return */ register int c, x = ttyDisplay ? (int) ttyDisplay->dismiss_more : '\n'; morc = 0; + while ( #ifdef HANGUPHANDLING - if (program_state.done_hup) return; + !program_state.done_hup && #endif + (c = tty_nhgetch()) != EOF) { + if (c == '\n') break; - while((c = tty_nhgetch()) != '\n') { if(iflags.cbreak) { - if (c == EOF || c == '\033') { - ttyDisplay->dismiss_more = 1; + if (c == '\033') { + if (ttyDisplay) ttyDisplay->dismiss_more = 1; morc = '\033'; break; } @@ -244,7 +246,6 @@ register const char *s; /* chars allowed besides return */ tty_nhbell(); } } - } /* -- 2.40.0