commit bash-20170525 snapshot

This commit is contained in:
Chet Ramey
2017-05-30 14:19:28 -04:00
parent 5378804dbf
commit 8b6b8f6094
12 changed files with 130 additions and 21 deletions
+10
View File
@@ -283,6 +283,16 @@ read_history_range (const char *filename, int from, int to)
if ((file < 0) || (fstat (file, &finfo) == -1))
goto error_and_exit;
if (S_ISREG (finfo.st_mode) == 0)
{
#ifdef EFTYPE
errno = EFTYPE;
#else
errno = EINVAL;
#endif
goto error_and_exit;
}
file_size = (size_t)finfo.st_size;
/* check for overflow on very large files */
+1 -1
View File
@@ -1067,7 +1067,7 @@ _rl_subseq_result (int r, Keymap map, int key, int got_subseq)
_rl_dispatching_keymap = map;
return -2;
}
else if (r && got_subseq)
else if (r < 0 && got_subseq) /* XXX */
{
/* OK, back up the chain. */
if (RL_ISSTATE (RL_STATE_MACROINPUT))
+15
View File
@@ -267,6 +267,9 @@ _rl_nsearch_abort (_rl_search_cxt *cxt)
static int
_rl_nsearch_dispatch (_rl_search_cxt *cxt, int c)
{
if (c < 0)
c = CTRL ('C');
switch (c)
{
case CTRL('W'):
@@ -374,6 +377,12 @@ noninc_search (int dir, int pchar)
{
c = _rl_search_getchar (cxt);
if (c < 0)
{
_rl_nsearch_abort (cxt);
return 1;
}
if (c == 0)
break;
@@ -455,6 +464,12 @@ _rl_nsearch_callback (_rl_search_cxt *cxt)
int c, r;
c = _rl_search_getchar (cxt);
if (c <= 0)
{
if (c < 0)
_rl_nsearch_abort (cxt);
return 1;
}
r = _rl_nsearch_dispatch (cxt, c);
if (r != 0)
return 1;