mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-23 13:57:58 +02:00
commit bash-20170630 snapshot
This commit is contained in:
@@ -14224,3 +14224,24 @@ builtins/read.def
|
||||
- read_builtin: if -n or -N is supplied with a 0 argument, try a zero-
|
||||
length read to detect errors and return failure if that read returns
|
||||
a value < 0. Suggested by dualbus@gmail.com
|
||||
|
||||
7/4
|
||||
---
|
||||
bashhist.c
|
||||
- maybe_add_history: keep track of whether the current line is a shell
|
||||
comment, even if we're not adding it because it's in a multi-line
|
||||
command, so we use appropriate delimiters between it and any
|
||||
subsequent lines. Fixes bug reported by Grisha Levit
|
||||
<grishalevit@gmail.com> back on 2/28/2017
|
||||
|
||||
bashline.c
|
||||
- operate_and_get_next: if given an explicit argument, use that to
|
||||
choose which line in the history to use.
|
||||
|
||||
lib/readline/doc/rluser.texi,doc/bash.1
|
||||
- operate-and-get-next: document new effect of explicit numeric arg
|
||||
|
||||
lib/readline/complete.c
|
||||
- fnprint: make sure print_len is initialized before using it on
|
||||
systems without multibyte character support. Report and fix from
|
||||
Juan Manuel Guerrero <juan.guerrero@gmx.de>
|
||||
|
||||
+6
-2
@@ -723,7 +723,10 @@ void
|
||||
maybe_add_history (line)
|
||||
char *line;
|
||||
{
|
||||
int is_comment;
|
||||
|
||||
hist_last_line_added = 0;
|
||||
is_comment = shell_comment (line);
|
||||
|
||||
/* Don't use the value of history_control to affect the second
|
||||
and subsequent lines of a multi-line command (old code did
|
||||
@@ -731,14 +734,15 @@ maybe_add_history (line)
|
||||
if (current_command_line_count > 1)
|
||||
{
|
||||
if (current_command_first_line_saved &&
|
||||
((parser_state & PST_HEREDOC) || literal_history || dstack.delimiter_depth != 0 || shell_comment (line) != 1))
|
||||
((parser_state & PST_HEREDOC) || literal_history || dstack.delimiter_depth != 0 || is_comment != 1))
|
||||
bash_add_history (line);
|
||||
current_command_line_comment = is_comment ? current_command_line_count : -2;
|
||||
return;
|
||||
}
|
||||
|
||||
/* This is the first line of a (possible multi-line) command. Note whether
|
||||
or not we should save the first line and remember it. */
|
||||
current_command_line_comment = shell_comment (line) ? current_command_line_count : -2;
|
||||
current_command_line_comment = is_comment ? current_command_line_count : -2;
|
||||
current_command_first_line_saved = check_add_history (line, 0);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -909,9 +909,9 @@ operate_and_get_next (count, c)
|
||||
rl_newline (1, c);
|
||||
|
||||
/* Find the current line, and find the next line to use. */
|
||||
where = where_history ();
|
||||
where = rl_explicit_arg ? count : where_history ();
|
||||
|
||||
if (HISTORY_FULL () || (where >= history_length - 1))
|
||||
if (HISTORY_FULL () || (where >= history_length - 1) || rl_explicit_arg)
|
||||
saved_history_line_to_use = where;
|
||||
else
|
||||
saved_history_line_to_use = where + 1;
|
||||
|
||||
+3
-2
@@ -6183,8 +6183,9 @@ A synonym for \fByank\-last\-arg\fP.
|
||||
.TP
|
||||
.B operate\-and\-get\-next (C\-o)
|
||||
Accept the current line for execution and fetch the next line
|
||||
relative to the current line from the history for editing. Any
|
||||
argument is ignored.
|
||||
relative to the current line from the history for editing.
|
||||
A numeric argument, if supplied, specifies the history entry to use instead
|
||||
of the current line.
|
||||
.TP
|
||||
.B edit\-and\-execute\-command (C\-x C\-e)
|
||||
Invoke an editor on the current command line, and execute the result as shell
|
||||
|
||||
@@ -804,6 +804,8 @@ fnprint (const char *to_print, int prefix_bytes, const char *real_pathname)
|
||||
print_len = strlen (to_print);
|
||||
end = to_print + print_len + 1;
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
#else
|
||||
print_len = strlen (to_print);
|
||||
#endif
|
||||
|
||||
printed_len = common_prefix_len = 0;
|
||||
|
||||
@@ -1732,8 +1732,9 @@ A synonym for @code{yank-last-arg}.
|
||||
|
||||
@item operate-and-get-next (C-o)
|
||||
Accept the current line for execution and fetch the next line
|
||||
relative to the current line from the history for editing. Any
|
||||
argument is ignored.
|
||||
relative to the current line from the history for editing.
|
||||
A numeric argument, if supplied, specifies the history entry to use instead
|
||||
of the current line.
|
||||
|
||||
@item edit-and-execute-command (C-x C-e)
|
||||
Invoke an editor on the current command line, and execute the result as shell
|
||||
|
||||
@@ -4,7 +4,7 @@ Copyright (C) 1988-2017 Free Software Foundation, Inc.
|
||||
|
||||
@set EDITION 7.0
|
||||
@set VERSION 7.0
|
||||
@set UPDATED 21 April 2017
|
||||
@set UPDATED-MONTH April 2017
|
||||
@set UPDATED 4 July 2017
|
||||
@set UPDATED-MONTH July 2017
|
||||
|
||||
@set LASTCHANGE Fri Apr 21 15:25:17 EDT 2017
|
||||
@set LASTCHANGE Tue Jul 4 16:32:48 EDT 2017
|
||||
|
||||
Reference in New Issue
Block a user