diff options
author | axel <axel@liljencrantz.se> | 2006-11-19 07:15:31 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-11-19 07:15:31 +1000 |
commit | 5d864e3f690f36cb9c31549375126a2e202ff946 (patch) | |
tree | 88e01910d8df315df1d4b07e088e7bb2f3626bc1 /input_common.c | |
parent | 1b71f91a014996d60886885c6fee091e8013d988 (diff) |
After processing a signal/event while waiting for commandline input, check the lookahead buffer for inserted characters
darcs-hash:20061118211531-ac50b-355fd5556f65e9cec3af5ed9e19a44af9bfe3b7b.gz
Diffstat (limited to 'input_common.c')
-rw-r--r-- | input_common.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/input_common.c b/input_common.c index 03af3a40..a4741bb6 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 ) ) |