commit bash-20170505 snapshot

This commit is contained in:
Chet Ramey
2017-05-08 10:53:50 -04:00
parent 2a39157723
commit af2a77fbbc
14 changed files with 125 additions and 30 deletions
+4 -1
View File
@@ -441,7 +441,10 @@ rl_translate_keyseq (const char *seq, char *array, int *len)
c = seq[++i];
if (c == 0)
break;
{
array[l++] = '\\'; /* preserve trailing backslash */
break;
}
/* Handle \C- and \M- prefixes. */
if ((c == 'C' || c == 'M') && seq[i + 1] == '-')
+1 -1
View File
@@ -137,7 +137,7 @@ fcopy(fp)
if (vflag && isascii ((unsigned char)c) && isprint((unsigned char)c) == 0)
{
x = rl_untranslate_keyseq (c);
if (fputs (x, stdout) != 0)
if (fputs (x, stdout) == EOF)
return 1;
}
else if (putchar (c) == EOF)
+1 -1
View File
@@ -128,7 +128,7 @@ _rl_copy_to_kill_ring (char *text, int append)
slot = rl_kill_ring_length - 1;
/* If the last command was a kill, prepend or append. */
if (_rl_last_command_was_kill && rl_editing_mode != vi_mode)
if (_rl_last_command_was_kill && rl_kill_ring[slot] && rl_editing_mode != vi_mode)
{
old = rl_kill_ring[slot];
new = (char *)xmalloc (1 + strlen (old) + strlen (text));
+5 -2
View File
@@ -578,7 +578,7 @@ rl_get_previous_history (int count, int key)
if (count < 0)
return (rl_get_next_history (-count, key));
if (count == 0)
if (count == 0 || history_list () == 0)
return 0;
/* either not saved by rl_newline or at end of line, so set appropriately. */
@@ -608,7 +608,10 @@ rl_get_previous_history (int count, int key)
temp = old_temp;
if (temp == 0)
rl_ding ();
{
rl_maybe_unsave_line ();
rl_ding ();
}
else
{
rl_replace_from_history (temp, 0);