summaryrefslogtreecommitdiff
path: root/contrib/libreadline/text.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2007-11-07 04:34:03 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2007-11-07 04:34:03 +0000
commit856ca0bc92498c33fee8862b1b0632d1f66f2753 (patch)
treef5cb0e516b57ee618c23a683d5d3f4fb2818a0d6 /contrib/libreadline/text.c
parentfe4cca3e28d67256c2b8fff1a4cc2fdac6ed7bb3 (diff)
Notes
Diffstat (limited to 'contrib/libreadline/text.c')
-rw-r--r--contrib/libreadline/text.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/libreadline/text.c b/contrib/libreadline/text.c
index 399a48c5f1e7a..cb2f5ad201598 100644
--- a/contrib/libreadline/text.c
+++ b/contrib/libreadline/text.c
@@ -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