This commit was generated by cvs2svn to compensate for changes in r173403,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
77963b5d45
@ -133,8 +133,11 @@ rl_get_char (key)
|
||||
return (0);
|
||||
|
||||
*key = ibuffer[pop_index++];
|
||||
|
||||
#if 0
|
||||
if (pop_index >= ibuffer_len)
|
||||
#else
|
||||
if (pop_index > ibuffer_len)
|
||||
#endif
|
||||
pop_index = 0;
|
||||
|
||||
return (1);
|
||||
@ -250,7 +253,8 @@ rl_gather_tyi ()
|
||||
while (chars_avail--)
|
||||
{
|
||||
k = (*rl_getc_function) (rl_instream);
|
||||
rl_stuff_char (k);
|
||||
if (rl_stuff_char (k) == 0)
|
||||
break; /* some problem; no more room */
|
||||
if (k == NEWLINE || k == RETURN)
|
||||
break;
|
||||
}
|
||||
@ -373,7 +377,11 @@ rl_stuff_char (key)
|
||||
RL_SETSTATE (RL_STATE_INPUTPENDING);
|
||||
}
|
||||
ibuffer[push_index++] = key;
|
||||
#if 0
|
||||
if (push_index >= ibuffer_len)
|
||||
#else
|
||||
if (push_index > ibuffer_len)
|
||||
#endif
|
||||
push_index = 0;
|
||||
|
||||
return 1;
|
||||
@ -513,20 +521,26 @@ _rl_read_mbchar (mbchar, size)
|
||||
char *mbchar;
|
||||
int size;
|
||||
{
|
||||
int mb_len = 0;
|
||||
int mb_len, c;
|
||||
size_t mbchar_bytes_length;
|
||||
wchar_t wc;
|
||||
mbstate_t ps, ps_back;
|
||||
|
||||
memset(&ps, 0, sizeof (mbstate_t));
|
||||
memset(&ps_back, 0, sizeof (mbstate_t));
|
||||
|
||||
|
||||
mb_len = 0;
|
||||
while (mb_len < size)
|
||||
{
|
||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||
mbchar[mb_len++] = rl_read_key ();
|
||||
c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
if (c < 0)
|
||||
break;
|
||||
|
||||
mbchar[mb_len++] = c;
|
||||
|
||||
mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
|
||||
if (mbchar_bytes_length == (size_t)(-1))
|
||||
break; /* invalid byte sequence for the current locale */
|
||||
@ -564,7 +578,7 @@ _rl_read_mbstring (first, mb, mlen)
|
||||
|
||||
c = first;
|
||||
memset (mb, 0, mlen);
|
||||
for (i = 0; i < mlen; i++)
|
||||
for (i = 0; c >= 0 && i < mlen; i++)
|
||||
{
|
||||
mb[i] = (char)c;
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
|
@ -327,8 +327,15 @@ _rl_isearch_dispatch (cxt, c)
|
||||
rl_command_func_t *f;
|
||||
|
||||
f = (rl_command_func_t *)NULL;
|
||||
|
||||
/* Translate the keys we do something with to opcodes. */
|
||||
|
||||
if (c < 0)
|
||||
{
|
||||
cxt->sflags |= SF_FAILED;
|
||||
cxt->history_pos = cxt->last_found_line;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Translate the keys we do something with to opcodes. */
|
||||
if (c >= 0 && _rl_keymap[c].type == ISFUNC)
|
||||
{
|
||||
f = _rl_keymap[c].function;
|
||||
|
@ -146,6 +146,8 @@ _rl_arg_dispatch (cxt, c)
|
||||
rl_restore_prompt ();
|
||||
rl_clear_message ();
|
||||
RL_UNSETSTATE(RL_STATE_NUMERICARG);
|
||||
if (key < 0)
|
||||
return -1;
|
||||
return (_rl_dispatch (key, _rl_keymap));
|
||||
}
|
||||
}
|
||||
|
@ -645,6 +645,11 @@ _rl_dispatch_callback (cxt)
|
||||
if ((cxt->flags & KSEQ_DISPATCHED) == 0)
|
||||
{
|
||||
nkey = _rl_subseq_getchar (cxt->okey);
|
||||
if (nkey < 0)
|
||||
{
|
||||
_rl_abort_internal ();
|
||||
return -1;
|
||||
}
|
||||
r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
|
||||
cxt->flags |= KSEQ_DISPATCHED;
|
||||
}
|
||||
|
@ -857,6 +857,9 @@ _rl_insert_next (count)
|
||||
c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
if (c < 0)
|
||||
return -1;
|
||||
|
||||
#if defined (HANDLE_SIGNALS)
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK) == 0)
|
||||
_rl_restore_tty_signals ();
|
||||
@ -1520,6 +1523,9 @@ _rl_char_search (count, fdir, bdir)
|
||||
|
||||
mb_len = _rl_read_mbchar (mbchar, MB_LEN_MAX);
|
||||
|
||||
if (mb_len <= 0)
|
||||
return -1;
|
||||
|
||||
if (count < 0)
|
||||
return (_rl_char_search_internal (-count, bdir, mbchar, mb_len));
|
||||
else
|
||||
@ -1536,6 +1542,9 @@ _rl_char_search (count, fdir, bdir)
|
||||
c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
if (c < 0)
|
||||
return -1;
|
||||
|
||||
if (count < 0)
|
||||
return (_rl_char_search_internal (-count, bdir, c));
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user