mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-08 03:02:40 +02:00
commit bash-20150821 snapshot
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* input.c -- character input functions for readline. */
|
||||
|
||||
/* Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU Readline Library (Readline), a library
|
||||
for reading lines of text with interactive input and history editing.
|
||||
@@ -216,8 +216,8 @@ rl_gather_tyi ()
|
||||
#endif
|
||||
|
||||
result = -1;
|
||||
#if defined (FIONREAD)
|
||||
errno = 0;
|
||||
#if defined (FIONREAD)
|
||||
result = ioctl (tty, FIONREAD, &chars_avail);
|
||||
if (result == -1 && errno == EIO)
|
||||
return -1;
|
||||
@@ -236,6 +236,8 @@ rl_gather_tyi ()
|
||||
fcntl (tty, F_SETFL, tem);
|
||||
if (chars_avail == -1 && errno == EAGAIN)
|
||||
return 0;
|
||||
if (chars_avail == -1 && errno == EIO)
|
||||
return -1;
|
||||
if (chars_avail == 0) /* EOF */
|
||||
{
|
||||
rl_stuff_char (EOF);
|
||||
@@ -464,7 +466,7 @@ rl_read_key ()
|
||||
if ((r = rl_gather_tyi ()) < 0) /* XXX - EIO */
|
||||
{
|
||||
rl_done = 1;
|
||||
return ('\n');
|
||||
return (errno == EIO ? (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF) : '\n');
|
||||
}
|
||||
else if (r > 0) /* read something */
|
||||
continue;
|
||||
|
||||
+3
-1
@@ -128,7 +128,7 @@ _rl_arg_dispatch (cxt, c)
|
||||
|
||||
/* If we see a key bound to `universal-argument' after seeing digits,
|
||||
it ends the argument but is otherwise ignored. */
|
||||
if (_rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument)
|
||||
if (c >= 0 && _rl_keymap[c].type == ISFUNC && _rl_keymap[c].function == rl_universal_argument)
|
||||
{
|
||||
if ((cxt & NUM_SAWDIGITS) == 0)
|
||||
{
|
||||
@@ -268,6 +268,8 @@ _rl_arg_callback (cxt)
|
||||
int c, r;
|
||||
|
||||
c = _rl_arg_getchar ();
|
||||
if (c < 0)
|
||||
return (1); /* EOF */
|
||||
|
||||
if (_rl_argcxt & NUM_READONE)
|
||||
{
|
||||
|
||||
+3
-1
@@ -610,7 +610,7 @@ rl_skip_csi_sequence (count, key)
|
||||
while (ch >= 0x20 && ch < 0x40);
|
||||
RL_UNSETSTATE (RL_STATE_MOREINPUT);
|
||||
|
||||
return 0;
|
||||
return (ch < 0);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -622,6 +622,8 @@ rl_arrow_keys (count, c)
|
||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||
ch = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
if (ch < 0)
|
||||
return (1);
|
||||
|
||||
switch (_rl_to_upper (ch))
|
||||
{
|
||||
|
||||
@@ -1280,8 +1280,8 @@ _rl_vi_domove_callback (m)
|
||||
int c, r;
|
||||
|
||||
m->motion = c = rl_vi_domove_getchar (m);
|
||||
/* XXX - what to do if this returns -1? Should we return 1 for eof to
|
||||
callback code? */
|
||||
if (c < 0)
|
||||
return 1; /* EOF */
|
||||
r = rl_domove_read_callback (m);
|
||||
|
||||
return ((r == 0) ? r : 1); /* normalize return values */
|
||||
|
||||
Reference in New Issue
Block a user