commit bash-20190220 snapshot

This commit is contained in:
Chet Ramey
2019-02-22 09:14:00 -05:00
parent be4078d25f
commit 9e48f85654
13 changed files with 422 additions and 33 deletions
+7 -1
View File
@@ -560,15 +560,18 @@ pre_process_line (line, print_changes, addit)
add that line to the history if ADDIT is non-zero. */
if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
{
int old_len;
/* If we are expanding the second or later line of a multi-line
command, decrease history_length so references to history expansions
in these lines refer to the previous history entry and not the
current command. */
old_len = history_length;
if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
history_length--;
expanded = history_expand (line, &history_value);
if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
history_length++;
history_length = old_len;
if (expanded)
{
@@ -908,6 +911,9 @@ bash_add_history (line)
}
}
if (add_it && history_is_stifled() && history_length == 0 && history_length == history_max_entries)
add_it = 0;
if (add_it)
really_add_history (line);