From 5d864e3f690f36cb9c31549375126a2e202ff946 Mon Sep 17 00:00:00 2001 From: axel Date: Sun, 19 Nov 2006 07:15:31 +1000 Subject: [PATCH] After processing a signal/event while waiting for commandline input, check the lookahead buffer for inserted characters darcs-hash:20061118211531-ac50b-355fd5556f65e9cec3af5ed9e19a44af9bfe3b7b.gz --- input.c | 2 ++ input_common.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/input.c b/input.c index 654b94b52..c32cd6fb6 100644 --- a/input.c +++ b/input.c @@ -1675,6 +1675,8 @@ wint_t input_readch() { int i; + + CHECK_BLOCK(); /* Clear the interrupted flag diff --git a/input_common.c b/input_common.c index 03af3a407..a4741bb6e 100644 --- a/input_common.c +++ b/input_common.c @@ -98,6 +98,11 @@ static wint_t readb() { return res; } + if( lookahead_count ) + { + return lookahead_arr[--lookahead_count]; + } + } @@ -107,7 +112,7 @@ static wint_t readb() default: { /* - The teminal has been closed. Save and exit. + The terminal has been closed. Save and exit. */ return R_EOF; } @@ -122,6 +127,11 @@ static wint_t readb() debug( 3, L"Wake up on universal variable event" ); env_universal_read_all(); do_loop = 1; + + if( lookahead_count ) + { + return lookahead_arr[--lookahead_count]; + } } } if( FD_ISSET( 0, &fd ) )