mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-30 08:59:56 +02:00
commit bash-20170505 snapshot
This commit is contained in:
+4
-1
@@ -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] == '-')
|
||||
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user