From 7a127e743dce04c760155ea184dad81cf6e02f1d Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 10 Jul 2012 09:43:57 -0400 Subject: Bash-4.2 patch 31 --- lib/readline/input.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/readline/input.c b/lib/readline/input.c index 7c74c99..b49af88 100644 --- a/lib/readline/input.c +++ b/lib/readline/input.c @@ -409,7 +409,7 @@ rl_clear_pending_input () int rl_read_key () { - int c; + int c, r; rl_key_sequence_length++; @@ -429,14 +429,18 @@ rl_read_key () { while (rl_event_hook) { - if (rl_gather_tyi () < 0) /* XXX - EIO */ + if (rl_get_char (&c) != 0) + break; + + if ((r = rl_gather_tyi ()) < 0) /* XXX - EIO */ { rl_done = 1; return ('\n'); } + else if (r == 1) /* read something */ + continue; + RL_CHECK_SIGNALS (); - if (rl_get_char (&c) != 0) - break; if (rl_done) /* XXX - experimental */ return ('\n'); (*rl_event_hook) (); -- cgit v1.2.3