After processing a signal/event while waiting for commandline input, check the lookahead buffer for inserted characters

darcs-hash:20061118211531-ac50b-355fd5556f65e9cec3af5ed9e19a44af9bfe3b7b.gz
This commit is contained in:
axel 2006-11-19 07:15:31 +10:00
parent 1b71f91a01
commit 5d864e3f69
2 changed files with 13 additions and 1 deletions

View file

@ -1675,6 +1675,8 @@ wint_t input_readch()
{ {
int i; int i;
CHECK_BLOCK();
/* /*
Clear the interrupted flag Clear the interrupted flag

View file

@ -98,6 +98,11 @@ static wint_t readb()
{ {
return res; return res;
} }
if( lookahead_count )
{
return lookahead_arr[--lookahead_count];
}
} }
@ -107,7 +112,7 @@ static wint_t readb()
default: default:
{ {
/* /*
The teminal has been closed. Save and exit. The terminal has been closed. Save and exit.
*/ */
return R_EOF; return R_EOF;
} }
@ -122,6 +127,11 @@ static wint_t readb()
debug( 3, L"Wake up on universal variable event" ); debug( 3, L"Wake up on universal variable event" );
env_universal_read_all(); env_universal_read_all();
do_loop = 1; do_loop = 1;
if( lookahead_count )
{
return lookahead_arr[--lookahead_count];
}
} }
} }
if( FD_ISSET( 0, &fd ) ) if( FD_ISSET( 0, &fd ) )