Bug-Reported-by: Thomas Loeber <ifp@loeber1.de>
Bug-Reference-ID: <200703082223.08919.ifp@loeber1.de>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00036.html
When rl_read_key returns -1, indicating that readline's controlling terminal
has been invalidated for some reason (e.g., receiving a SIGHUP), the error
status was not reported correctly to the caller. This could cause input
*** ../readline-5.2/complete.c Fri Jul 28 11:35:49 2006
--- ./complete.c Tue Mar 13 08:50:16 2007
if (c == 'n' || c == 'N' || c == RUBOUT)
if (for_pager && (c == NEWLINE || c == RETURN))
if (c == 'n' || c == 'N' || c == RUBOUT)
! if (c == ABORT_CHAR || c < 0)
if (for_pager && (c == NEWLINE || c == RETURN))
*** ../readline-5.2/input.c Wed Aug 16 15:15:16 2006
--- ./input.c Wed May 2 16:07:59 2007
size_t mbchar_bytes_length;
size_t mbchar_bytes_length;
memset(&ps, 0, sizeof (mbstate_t));
memset(&ps_back, 0, sizeof (mbstate_t));
RL_SETSTATE(RL_STATE_MOREINPUT);
! mbchar[mb_len++] = rl_read_key ();
RL_UNSETSTATE(RL_STATE_MOREINPUT);
mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
if (mbchar_bytes_length == (size_t)(-1))