readline changes to use xfree; bumped version to bash-5.2-beta

This commit is contained in:
Chet Ramey
2022-04-08 11:03:02 -04:00
parent 505f60f94c
commit 0b9a4b3ae0
20 changed files with 939 additions and 774 deletions
+75
View File
@@ -1,3 +1,78 @@
This document details the changes between this version, bash-5.2-beta, and
the previous version, bash-5.2-alpha.
1. Changes to Bash
a. Fixed a problem with command-oriented history and multi-line commands that
caused embedded blank lines to be run together.
b. Changed the way `&' is quoted when performing pattern substitution and
`patsub_replacement' is enabled.
c. Fixed some integer overflows when expanding strings or reading the output
of command substitution larger than 2GB.
d. `wait -p' without the `-n' option now does something useful if there are no
jobs.
e. Fixed an issue with read timeouts in posix mode.
f. Changed here-document processing to process $'...' and $"..." only when they
appear in the WORD portion of ${PARAM OP WORD} in the here-document body
and the body is being expanded.
g. Changed alias expansion in command substitution to be posix-conformant
(performed while initially parsing the command substitution) when in posix
mode.
h. Bash optimizes away more forks in subshells.
i. Here-document construction now performs quote removal on the here-document
delimiter only if it's marked as quoted, which prevents quote characters in
command substitutions from being removed.
j. Prompt string expansion now gives invisible characters in the expansion of
the \w, \W, and \s escape sequences a visible representation to avoid
problems with redisplay.
k. Fixed a problem with SIGINT during the execution of a command bound with
`bind -x' affecting the saved terminal settings.
l. Fixed an inconsistency with how $@ expands in a construct like ${@:+set}
or ${array[@]:+set} in the presence of null positional parameters or
array elements.
2. Changes to Readline
a. Prevent some display problems when running a command as the result of a
trap or one bound using `bind -x' and the command generates output.
b. Fixed an issue with multi-line prompt strings that have one or more
invisible characters at the end of a physical line.
c. Fixed an issue that caused a history line's undo list to be cleared when
it should not have been.
3. New Features in Bash
a. There is a new bindable readline command name: `vi-edit-and-execute-command'.
4. New Features in Readline
a. Two new bindable string variables: active-region-start-color and
active-region-end-color. The first sets the color used to display the
active region; the second turns it off. If set, these are used in place
of terminal standout mode.
b. New readline state (RL_STATE_EOF) and application-visible variable
(rl_eof_found) to allow applications to detect when readline reads EOF
before calling the deprep-terminal hook.
c. There is a new configuration option: --with-shared-termcap-library, which
forces linking the shared readline library with the shared termcap (or
curses/ncurses/termlib) library so applications don't have to do it.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-alpha, and
the previous version, bash-5.1-release.
+75
View File
@@ -1,3 +1,78 @@
This document details the changes between this version, bash-5.2-beta, and
the previous version, bash-5.2-alpha.
1. Changes to Bash
a. Fixed a problem with command-oriented history and multi-line commands that
caused embedded blank lines to be run together.
b. Changed the way `&' is quoted when performing pattern substitution and
`patsub_replacement' is enabled.
c. Fixed some integer overflows when expanding strings or reading the output
of command substitution larger than 2GB.
d. `wait -p' without the `-n' option now does something useful if there are no
jobs.
e. Fixed an issue with read timeouts in posix mode.
f. Changed here-document processing to process $'...' and $"..." only when they
appear in the WORD portion of ${PARAM OP WORD} in the here-document body
and the body is being expanded.
g. Changed alias expansion in command substitution to be posix-conformant
(performed while initially parsing the command substitution) when in posix
mode.
h. Bash optimizes away more forks in subshells.
i. Here-document construction now performs quote removal on the here-document
delimiter only if it's marked as quoted, which prevents quote characters in
command substitutions from being removed.
j. Prompt string expansion now gives invisible characters in the expansion of
the \w, \W, and \s escape sequences a visible representation to avoid
problems with redisplay.
k. Fixed a problem with SIGINT during the execution of a command bound with
`bind -x' affecting the saved terminal settings.
l. Fixed an inconsistency with how $@ expands in a construct like ${@:+set}
or ${array[@]:+set} in the presence of null positional parameters or
array elements.
2. Changes to Readline
a. Prevent some display problems when running a command as the result of a
trap or one bound using `bind -x' and the command generates output.
b. Fixed an issue with multi-line prompt strings that have one or more
invisible characters at the end of a physical line.
c. Fixed an issue that caused a history line's undo list to be cleared when
it should not have been.
3. New Features in Bash
a. There is a new bindable readline command name: `vi-edit-and-execute-command'.
4. New Features in Readline
a. Two new bindable string variables: active-region-start-color and
active-region-end-color. The first sets the color used to display the
active region; the second turns it off. If set, these are used in place
of terminal standout mode.
b. New readline state (RL_STATE_EOF) and application-visible variable
(rl_eof_found) to allow applications to detect when readline reads EOF
before calling the deprep-terminal hook.
c. There is a new configuration option: --with-shared-termcap-library, which
forces linking the shared readline library with the shared termcap (or
curses/ncurses/termlib) library so applications don't have to do it.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-alpha, and
the previous version, bash-5.1-release.
+31 -20
View File
@@ -3407,34 +3407,45 @@ lib/readline/search.c
----
subst.c
- parameter_brace_expand_word: if we have double-quoted ${*} or ${@},
make sure we are setting W_HASQUOTEDNULL in the flags we return to the
caller if we are returning QUOTED_NULL(word)
- parameter_brace_expand_word: if we have a double-quoted associative array
reference using `*' or `@', make sure we are setting W_HASQUOTEDNULL in the flags
we return to the caller if we are returning QUOTED_NULL(word)
- parameter_brace_expand: if we're using the `[:]+' word expansion operator,
we need to note a quoted null string and pass the W_QUOTEDNULL flag
back to the caller
- expand_word_internal: make sure to return a QUOTED_NULL (word[0] == CTLNUL)
back to the caller if HAD_QUOTED_NULL is set, regardless of whether or
not we see a quoted dollar at. Fix for bug reported by
Andreas Luik <andreas.luik@innovative-navigation.de>
make sure we are setting W_HASQUOTEDNULL in the flags we return to
the caller if we are returning QUOTED_NULL(word)
- parameter_brace_expand_word: if we have a double-quoted associative
array reference using `*' or `@', make sure we are setting
W_HASQUOTEDNULL in the flags we return to the caller if we are
returning QUOTED_NULL(word)
- parameter_brace_expand: if we're using the `[:]+' word expansion
operator, we need to note a quoted null string and pass the
W_QUOTEDNULL flag back to the caller
- expand_word_internal: make sure to return a QUOTED_NULL
(word[0] == CTLNUL) back to the caller if HAD_QUOTED_NULL is set,
regardless of whether or not we see a quoted dollar at. Fix for bug
reported by Andreas Luik <andreas.luik@innovative-navigation.de>
arrayfunc.c
- array_value_internal: fix typo and set estatep->type to ARRAY_INDEXED for
indexed arrays
- array_value_internal: fix typo and set estatep->type to ARRAY_INDEXED
for indexed arrays
3/31
----
lib/readline/{history.c,histlib.h}
- _hs_at_end_of_history: convenience function to tell whether or not the
current history position is at the end of the history list
- _hs_at_end_of_history: convenience function to tell whether or not
the current history position is at the end of the history list
4/1
---
lib/readline/search.c
- make_history_line_current: don't free rl_undo_list if it is equal to
_rl_saved_line_for_history->data, since we will need to restore it later
if we got it from a history entry. Fixes issue dating back to 7/2021 and
changes to _rl_free_saved_line_for_history, current issue reported by
Andreas Schwab <schwab@linux-m68k.org>
_rl_saved_line_for_history->data, since we will need to restore it
later if we got it from a history entry. Fixes issue dating back to
7/2021 and changes to _rl_free_saved_line_for_history, current issue
reported by Andreas Schwab <schwab@linux-m68k.org>
4/5
---
lib/readline/{complete,histfile,histsearch,isearch,terminal}.c
- xfree: use instead of free
4/7
---
configure.ac
- bumped version to bash-5.2-beta
+16
View File
@@ -97,6 +97,9 @@ bb. Array references using `@' and `*' that are the value of nameref variables
(declare -n ref='v[@]' ; echo $ref) no longer cause the shell to exit if
set -u is enabled and the array (v) is unset.
cc. There is a new bindable readline command name:
`vi-edit-and-execute-command'.
2. New Features in Readline
a. There is now an HS_HISTORY_VERSION containing the version number of the
@@ -133,6 +136,19 @@ i. Readline looks in $LS_COLORS for a custom filename extension
(*.readline-colored-completion-prefix) and uses that as the default color
for the common prefix displayed when `colored-completion-prefix' is set.
j. Two new bindable string variables: active-region-start-color and
active-region-end-color. The first sets the color used to display the
active region; the second turns it off. If set, these are used in place
of terminal standout mode.
k. New readline state (RL_STATE_EOF) and application-visible variable
(rl_eof_found) to allow applications to detect when readline reads EOF
before calling the deprep-terminal hook.
l. There is a new configuration option: --with-shared-termcap-library, which
forces linking the shared readline library with the shared termcap (or
curses/ncurses/termlib) library so applications don't have to do it.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-5.1 since
the release of bash-5.0. As always, the manual page (doc/bash.1) is
+16
View File
@@ -97,6 +97,9 @@ bb. Array references using `@' and `*' that are the value of nameref variables
(declare -n ref='v[@]' ; echo $ref) no longer cause the shell to exit if
set -u is enabled and the array (v) is unset.
cc. There is a new bindable readline command name:
`vi-edit-and-execute-command'.
2. New Features in Readline
a. There is now an HS_HISTORY_VERSION containing the version number of the
@@ -132,3 +135,16 @@ h. rl_completer_word_break_characters is now `const char *' like
i. Readline looks in $LS_COLORS for a custom filename extension
(*.readline-colored-completion-prefix) and uses that as the default color
for the common prefix displayed when `colored-completion-prefix' is set.
j. Two new bindable string variables: active-region-start-color and
active-region-end-color. The first sets the color used to display the
active region; the second turns it off. If set, these are used in place
of terminal standout mode.
k. New readline state (RL_STATE_EOF) and application-visible variable
(rl_eof_found) to allow applications to detect when readline reads EOF
before calling the deprep-terminal hook.
l. There is a new configuration option: --with-shared-termcap-library, which
forces linking the shared readline library with the shared termcap (or
curses/ncurses/termlib) library so applications don't have to do it.
Vendored
+10 -10
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac for Bash 5.2, version 5.039.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for bash 5.2-alpha.
# Generated by GNU Autoconf 2.71 for bash 5.2-beta.
#
# Report bugs to <bug-bash@gnu.org>.
#
@@ -612,8 +612,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='5.2-alpha'
PACKAGE_STRING='bash 5.2-alpha'
PACKAGE_VERSION='5.2-beta'
PACKAGE_STRING='bash 5.2-beta'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
PACKAGE_URL=''
@@ -1467,7 +1467,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bash 5.2-alpha to adapt to many kinds of systems.
\`configure' configures bash 5.2-beta to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1533,7 +1533,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 5.2-alpha:";;
short | recursive ) echo "Configuration of bash 5.2-beta:";;
esac
cat <<\_ACEOF
@@ -1740,7 +1740,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 5.2-alpha
bash configure 5.2-beta
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2397,7 +2397,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bash $as_me 5.2-alpha, which was
It was created by bash $as_me 5.2-beta, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -3176,7 +3176,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=5.2
RELSTATUS=alpha
RELSTATUS=beta
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|releng*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -22332,7 +22332,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bash $as_me 5.2-alpha, which was
This file was extended by bash $as_me 5.2-beta, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22400,7 +22400,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
bash config.status 5.2-alpha
bash config.status 5.2-beta
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
+1 -1
View File
@@ -24,7 +24,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_REVISION([for Bash 5.2, version 5.039])dnl
define(bashvers, 5.2)
define(relstatus, alpha)
define(relstatus, beta)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
+502 -490
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -3176,7 +3176,7 @@ ${\fIparameter\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP}
\fBSubstring Expansion\fP.
Expands to up to \fIlength\fP characters of the value of \fIparameter\fP
starting at the character specified by \fIoffset\fP.
If \fIparameter\fP is \fB@\fP, an indexed array subscripted by
If \fIparameter\fP is \fB@\fP or \fB*\fP, an indexed array subscripted by
\fB@\fP or \fB*\fP, or an associative array name, the results differ as
described below.
If \fIlength\fP is omitted, expands to the substring of the value of
@@ -3199,8 +3199,8 @@ a number of characters, and the expansion is the characters between
Note that a negative offset must be separated from the colon by at least
one space to avoid being confused with the \fB:-\fP expansion.
.sp 1
If \fIparameter\fP is \fB@\fP, the result is \fIlength\fP positional
parameters beginning at \fIoffset\fP.
If \fIparameter\fP is \fB@\fP or \fB*\fP, the result is \fIlength\fP
positional parameters beginning at \fIoffset\fP.
A negative \fIoffset\fP is taken relative to one greater than the greatest
positional parameter, so an offset of \-1 evaluates to the last positional
parameter.
+197 -183
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.8 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.2, 5 February 2022).
Bash shell (version 5.2, 24 February 2022).
This is Edition 5.2, last updated 5 February 2022, of 'The GNU Bash
This is Edition 5.2, last updated 24 February 2022, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Copyright (C) 1988-2022 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.2, 5 February 2022). The Bash home page is
Bash shell (version 5.2, 24 February 2022). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.2, last updated 5 February 2022, of 'The GNU Bash
This is Edition 5.2, last updated 24 February 2022, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Bash contains features that appear in other popular shells, and some
@@ -1368,9 +1368,17 @@ status; otherwise the function's return status is the exit status of the
last command executed before the 'return'.
Variables local to the function may be declared with the 'local'
builtin. These variables are visible only to the function and the
commands it invokes. This is particularly important when a shell
function calls other functions.
builtin ("local variables"). Ordinarily, variables and their values are
shared between a function and its caller. These variables are visible
only to the function and the commands it invokes. This is particularly
important when a shell function calls other functions.
In the following description, the "current scope" is a currently-
executing function. Previous scopes consist of that function's caller
and so on, back to the "global" scope, where the shell is not executing
any shell function. Consequently, a local variable at the current local
scope is a variable declared using the 'local' or 'declare' builtins in
the function that is currently executing.
Local variables "shadow" variables with the same name declared at
previous scopes. For instance, a local variable declared in a function
@@ -1415,11 +1423,12 @@ script displays
variable is local to the current scope, 'unset' will unset it; otherwise
the unset will refer to the variable found in any calling scope as
described above. If a variable at the current local scope is unset, it
will remain so until it is reset in that scope or until the function
returns. Once the function returns, any instance of the variable at a
previous scope will become visible. If the unset acts on a variable at
a previous scope, any instance of a variable with that name that had
been shadowed will become visible.
will remain so (appearing as unset) until it is reset in that scope or
until the function returns. Once the function returns, any instance of
the variable at a previous scope will become visible. If the unset acts
on a variable at a previous scope, any instance of a variable with that
name that had been shadowed will become visible (see below how
'localvar_unset'shell option changes this behavior).
Function names and definitions may be listed with the '-f' option to
the 'declare' ('typeset') builtin command (*note Bash Builtins::). The
@@ -1868,11 +1877,11 @@ omitted, the operator tests only for existence.
'${PARAMETER:OFFSET:LENGTH}'
This is referred to as Substring Expansion. It expands to up to
LENGTH characters of the value of PARAMETER starting at the
character specified by OFFSET. If PARAMETER is '@', an indexed
array subscripted by '@' or '*', or an associative array name, the
results differ as described below. If LENGTH is omitted, it
expands to the substring of the value of PARAMETER starting at the
character specified by OFFSET and extending to the end of the
character specified by OFFSET. If PARAMETER is '@' or '*', an
indexed array subscripted by '@' or '*', or an associative array
name, the results differ as described below. If LENGTH is omitted,
it expands to the substring of the value of PARAMETER starting at
the character specified by OFFSET and extending to the end of the
value. LENGTH and OFFSET are arithmetic expressions (*note Shell
Arithmetic::).
@@ -1940,11 +1949,11 @@ omitted, the operator tests only for existence.
$ echo ${array[0]: -7:-2}
bcdef
If PARAMETER is '@', the result is LENGTH positional parameters
beginning at OFFSET. A negative OFFSET is taken relative to one
greater than the greatest positional parameter, so an offset of -1
evaluates to the last positional parameter. It is an expansion
error if LENGTH evaluates to a number less than zero.
If PARAMETER is '@' or '*', the result is LENGTH positional
parameters beginning at OFFSET. A negative OFFSET is taken
relative to one greater than the greatest positional parameter, so
an offset of -1 evaluates to the last positional parameter. It is
an expansion error if LENGTH evaluates to a number less than zero.
The following examples illustrate substring expansion using
positional parameters:
@@ -6661,6 +6670,10 @@ negative number, that number is interpreted as relative to one greater
than the maximum index of NAME, so negative indices count back from the
end of the array, and an index of -1 references the last element.
The '+=' operator will append to an array variable when assigning
using the compound assignment syntax; see *note Shell Parameters::
above.
Any element of an array may be referenced using '${NAME[SUBSCRIPT]}'.
The braces are required to avoid conflicts with the shell's filename
expansion operators. If the SUBSCRIPT is '@' or '*', the word expands
@@ -8157,12 +8170,13 @@ Variable Settings
non-incremental history searches. The default is 'On'.
'enable-bracketed-paste'
When set to 'On', Readline will configure the terminal in a
way that will enable it to insert each paste into the editing
buffer as a single string of characters, instead of treating
each character as if it had been read from the keyboard. This
can prevent pasted characters from being interpreted as
editing commands. The default is 'On'.
When set to 'On', Readline configures the terminal to insert
each paste into the editing buffer as a single string of
characters, instead of treating each character as if it had
been read from the keyboard. This is called putting the
terminal into "bracketed paste mode"; it prevents Readline
from executing any editing commands bound to key sequences
appearing in the pasted text. The default is 'On'.
'enable-keypad'
When set to 'on', Readline will try to enable the application
@@ -11968,14 +11982,14 @@ D.3 Parameter and Variable Index
* enable-bracketed-paste: Readline Init File Syntax.
(line 185)
* enable-keypad: Readline Init File Syntax.
(line 193)
(line 194)
* ENV: Bash Variables. (line 279)
* EPOCHREALTIME: Bash Variables. (line 284)
* EPOCHSECONDS: Bash Variables. (line 292)
* EUID: Bash Variables. (line 299)
* EXECIGNORE: Bash Variables. (line 303)
* expand-tilde: Readline Init File Syntax.
(line 204)
(line 205)
* FCEDIT: Bash Variables. (line 316)
* FIGNORE: Bash Variables. (line 320)
* FUNCNAME: Bash Variables. (line 326)
@@ -11989,15 +12003,15 @@ D.3 Parameter and Variable Index
* HISTFILESIZE: Bash Variables. (line 402)
* HISTIGNORE: Bash Variables. (line 413)
* history-preserve-point: Readline Init File Syntax.
(line 208)
(line 209)
* history-size: Readline Init File Syntax.
(line 214)
(line 215)
* HISTSIZE: Bash Variables. (line 433)
* HISTTIMEFORMAT: Bash Variables. (line 440)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 223)
(line 224)
* HOSTFILE: Bash Variables. (line 448)
* HOSTNAME: Bash Variables. (line 459)
* HOSTTYPE: Bash Variables. (line 462)
@@ -12005,13 +12019,13 @@ D.3 Parameter and Variable Index
(line 18)
* IGNOREEOF: Bash Variables. (line 465)
* input-meta: Readline Init File Syntax.
(line 232)
(line 233)
* INPUTRC: Bash Variables. (line 475)
* INSIDE_EMACS: Bash Variables. (line 479)
* isearch-terminators: Readline Init File Syntax.
(line 240)
(line 241)
* keymap: Readline Init File Syntax.
(line 247)
(line 248)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 485)
@@ -12033,15 +12047,15 @@ D.3 Parameter and Variable Index
(line 27)
* MAPFILE: Bash Variables. (line 540)
* mark-modified-lines: Readline Init File Syntax.
(line 277)
(line 278)
* mark-symlinked-directories: Readline Init File Syntax.
(line 282)
(line 283)
* match-hidden-files: Readline Init File Syntax.
(line 287)
(line 288)
* menu-complete-display-prefix: Readline Init File Syntax.
(line 294)
(line 295)
* meta-flag: Readline Init File Syntax.
(line 232)
(line 233)
* OLDPWD: Bash Variables. (line 544)
* OPTARG: Bourne Shell Variables.
(line 34)
@@ -12050,9 +12064,9 @@ D.3 Parameter and Variable Index
(line 38)
* OSTYPE: Bash Variables. (line 551)
* output-meta: Readline Init File Syntax.
(line 299)
(line 300)
* page-completions: Readline Init File Syntax.
(line 305)
(line 306)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 554)
@@ -12075,19 +12089,19 @@ D.3 Parameter and Variable Index
* READLINE_POINT: Bash Variables. (line 626)
* REPLY: Bash Variables. (line 630)
* revert-all-at-newline: Readline Init File Syntax.
(line 315)
(line 316)
* SECONDS: Bash Variables. (line 633)
* SHELL: Bash Variables. (line 642)
* SHELLOPTS: Bash Variables. (line 647)
* SHLVL: Bash Variables. (line 656)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 321)
(line 322)
* show-all-if-unmodified: Readline Init File Syntax.
(line 327)
(line 328)
* show-mode-in-prompt: Readline Init File Syntax.
(line 336)
(line 337)
* skip-completed-text: Readline Init File Syntax.
(line 342)
(line 343)
* SRANDOM: Bash Variables. (line 661)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
@@ -12098,11 +12112,11 @@ D.3 Parameter and Variable Index
* TMPDIR: Bash Variables. (line 720)
* UID: Bash Variables. (line 724)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 355)
(line 356)
* vi-ins-mode-string: Readline Init File Syntax.
(line 366)
(line 367)
* visible-stats: Readline Init File Syntax.
(line 377)
(line 378)

File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes
@@ -12481,138 +12495,138 @@ D.5 Concept Index

Tag Table:
Node: Top895
Node: Introduction2813
Node: What is Bash?3029
Node: What is a shell?4143
Node: Definitions6681
Node: Basic Shell Features9632
Node: Shell Syntax10851
Node: Shell Operation11877
Node: Quoting13170
Node: Escape Character14474
Node: Single Quotes14959
Node: Double Quotes15307
Node: ANSI-C Quoting16585
Node: Locale Translation17895
Node: Creating Internationalized Scripts19206
Node: Comments23323
Node: Shell Commands23941
Node: Reserved Words24879
Node: Simple Commands25635
Node: Pipelines26289
Node: Lists29248
Node: Compound Commands31043
Node: Looping Constructs32055
Node: Conditional Constructs34550
Node: Command Grouping48894
Node: Coprocesses50372
Node: GNU Parallel53035
Node: Shell Functions53952
Node: Shell Parameters61243
Node: Positional Parameters65631
Node: Special Parameters66533
Node: Shell Expansions69747
Node: Brace Expansion71874
Node: Tilde Expansion74608
Node: Shell Parameter Expansion77229
Node: Command Substitution95566
Node: Arithmetic Expansion96921
Node: Process Substitution97889
Node: Word Splitting99009
Node: Filename Expansion100953
Node: Pattern Matching103702
Node: Quote Removal108310
Node: Redirections108605
Node: Executing Commands118265
Node: Simple Command Expansion118935
Node: Command Search and Execution121045
Node: Command Execution Environment123423
Node: Environment126458
Node: Exit Status128121
Node: Signals129905
Node: Shell Scripts133354
Node: Shell Builtin Commands136381
Node: Bourne Shell Builtins138419
Node: Bash Builtins159880
Node: Modifying Shell Behavior190736
Node: The Set Builtin191081
Node: The Shopt Builtin201682
Node: Special Builtins217594
Node: Shell Variables218573
Node: Bourne Shell Variables219010
Node: Bash Variables221114
Node: Bash Features253930
Node: Invoking Bash254943
Node: Bash Startup Files260956
Node: Interactive Shells266059
Node: What is an Interactive Shell?266469
Node: Is this Shell Interactive?267118
Node: Interactive Shell Behavior267933
Node: Bash Conditional Expressions271562
Node: Shell Arithmetic276204
Node: Aliases279148
Node: Arrays281761
Node: The Directory Stack288008
Node: Directory Stack Builtins288792
Node: Controlling the Prompt293052
Node: The Restricted Shell296017
Node: Bash POSIX Mode298627
Node: Shell Compatibility Mode310277
Node: Job Control318306
Node: Job Control Basics318766
Node: Job Control Builtins323768
Node: Job Control Variables329168
Node: Command Line Editing330324
Node: Introduction and Notation331995
Node: Readline Interaction333618
Node: Readline Bare Essentials334809
Node: Readline Movement Commands336592
Node: Readline Killing Commands337552
Node: Readline Arguments339470
Node: Searching340514
Node: Readline Init File342700
Node: Readline Init File Syntax343961
Node: Conditional Init Constructs367087
Node: Sample Init File371283
Node: Bindable Readline Commands374407
Node: Commands For Moving375611
Node: Commands For History377662
Node: Commands For Text382656
Node: Commands For Killing386305
Node: Numeric Arguments389338
Node: Commands For Completion390477
Node: Keyboard Macros394668
Node: Miscellaneous Commands395355
Node: Readline vi Mode401294
Node: Programmable Completion402201
Node: Programmable Completion Builtins409981
Node: A Programmable Completion Example420676
Node: Using History Interactively425923
Node: Bash History Facilities426607
Node: Bash History Builtins429612
Node: History Interaction434620
Node: Event Designators438240
Node: Word Designators439594
Node: Modifiers441354
Node: Installing Bash443165
Node: Basic Installation444302
Node: Compilers and Options448024
Node: Compiling For Multiple Architectures448765
Node: Installation Names450458
Node: Specifying the System Type452567
Node: Sharing Defaults453283
Node: Operation Controls453956
Node: Optional Features454914
Node: Reporting Bugs466132
Node: Major Differences From The Bourne Shell467407
Node: GNU Free Documentation License484257
Node: Indexes509434
Node: Builtin Index509888
Node: Reserved Word Index516715
Node: Variable Index519163
Node: Function Index535937
Node: Concept Index549721
Node: Top897
Node: Introduction2817
Node: What is Bash?3033
Node: What is a shell?4147
Node: Definitions6685
Node: Basic Shell Features9636
Node: Shell Syntax10855
Node: Shell Operation11881
Node: Quoting13174
Node: Escape Character14478
Node: Single Quotes14963
Node: Double Quotes15311
Node: ANSI-C Quoting16589
Node: Locale Translation17899
Node: Creating Internationalized Scripts19210
Node: Comments23327
Node: Shell Commands23945
Node: Reserved Words24883
Node: Simple Commands25639
Node: Pipelines26293
Node: Lists29252
Node: Compound Commands31047
Node: Looping Constructs32059
Node: Conditional Constructs34554
Node: Command Grouping48898
Node: Coprocesses50376
Node: GNU Parallel53039
Node: Shell Functions53956
Node: Shell Parameters61841
Node: Positional Parameters66229
Node: Special Parameters67131
Node: Shell Expansions70345
Node: Brace Expansion72472
Node: Tilde Expansion75206
Node: Shell Parameter Expansion77827
Node: Command Substitution96178
Node: Arithmetic Expansion97533
Node: Process Substitution98501
Node: Word Splitting99621
Node: Filename Expansion101565
Node: Pattern Matching104314
Node: Quote Removal108922
Node: Redirections109217
Node: Executing Commands118877
Node: Simple Command Expansion119547
Node: Command Search and Execution121657
Node: Command Execution Environment124035
Node: Environment127070
Node: Exit Status128733
Node: Signals130517
Node: Shell Scripts133966
Node: Shell Builtin Commands136993
Node: Bourne Shell Builtins139031
Node: Bash Builtins160492
Node: Modifying Shell Behavior191348
Node: The Set Builtin191693
Node: The Shopt Builtin202294
Node: Special Builtins218206
Node: Shell Variables219185
Node: Bourne Shell Variables219622
Node: Bash Variables221726
Node: Bash Features254542
Node: Invoking Bash255555
Node: Bash Startup Files261568
Node: Interactive Shells266671
Node: What is an Interactive Shell?267081
Node: Is this Shell Interactive?267730
Node: Interactive Shell Behavior268545
Node: Bash Conditional Expressions272174
Node: Shell Arithmetic276816
Node: Aliases279760
Node: Arrays282373
Node: The Directory Stack288764
Node: Directory Stack Builtins289548
Node: Controlling the Prompt293808
Node: The Restricted Shell296773
Node: Bash POSIX Mode299383
Node: Shell Compatibility Mode311033
Node: Job Control319062
Node: Job Control Basics319522
Node: Job Control Builtins324524
Node: Job Control Variables329924
Node: Command Line Editing331080
Node: Introduction and Notation332751
Node: Readline Interaction334374
Node: Readline Bare Essentials335565
Node: Readline Movement Commands337348
Node: Readline Killing Commands338308
Node: Readline Arguments340226
Node: Searching341270
Node: Readline Init File343456
Node: Readline Init File Syntax344717
Node: Conditional Init Constructs367916
Node: Sample Init File372112
Node: Bindable Readline Commands375236
Node: Commands For Moving376440
Node: Commands For History378491
Node: Commands For Text383485
Node: Commands For Killing387134
Node: Numeric Arguments390167
Node: Commands For Completion391306
Node: Keyboard Macros395497
Node: Miscellaneous Commands396184
Node: Readline vi Mode402123
Node: Programmable Completion403030
Node: Programmable Completion Builtins410810
Node: A Programmable Completion Example421505
Node: Using History Interactively426752
Node: Bash History Facilities427436
Node: Bash History Builtins430441
Node: History Interaction435449
Node: Event Designators439069
Node: Word Designators440423
Node: Modifiers442183
Node: Installing Bash443994
Node: Basic Installation445131
Node: Compilers and Options448853
Node: Compiling For Multiple Architectures449594
Node: Installation Names451287
Node: Specifying the System Type453396
Node: Sharing Defaults454112
Node: Operation Controls454785
Node: Optional Features455743
Node: Reporting Bugs466961
Node: Major Differences From The Bourne Shell468236
Node: GNU Free Documentation License485086
Node: Indexes510263
Node: Builtin Index510717
Node: Reserved Word Index517544
Node: Variable Index519992
Node: Function Index536766
Node: Concept Index550550

End Tag Table
+3 -3
View File
@@ -2221,7 +2221,7 @@ var is set and not null
This is referred to as Substring Expansion.
It expands to up to @var{length} characters of the value of @var{parameter}
starting at the character specified by @var{offset}.
If @var{parameter} is @samp{@@}, an indexed array subscripted by
If @var{parameter} is @samp{@@} or @samp{*}, an indexed array subscripted by
@samp{@@} or @samp{*}, or an associative array name, the results differ as
described below.
If @var{length} is omitted, it expands to the substring of the value of
@@ -2298,8 +2298,8 @@ $ echo ${array[0]: -7:-2}
bcdef
@end verbatim
If @var{parameter} is @samp{@@}, the result is @var{length} positional
parameters beginning at @var{offset}.
If @var{parameter} is @samp{@@} or @samp{*}, the result is @var{length}
positional parameters beginning at @var{offset}.
A negative @var{offset} is taken relative to one greater than the greatest
positional parameter, so an offset of -1 evaluates to the last positional
parameter.
+1 -1
View File
@@ -1981,7 +1981,7 @@ compare_match (char *text, const char *match)
{
temp = (*rl_filename_dequoting_function) (text, rl_completion_quote_character);
r = strcmp (temp, match);
free (temp);
xfree (temp);
return r;
}
return (strcmp (text, match));
+1 -1
View File
@@ -536,7 +536,7 @@ expand_prompt (char *pmt, int flags, int *lp, int *lip, int *niflp, int *vlp)
*vlp = physchars;
if (nprompt != pmt)
free (nprompt);
xfree (nprompt);
return ret;
}
+1 -1
View File
@@ -310,7 +310,7 @@ read_history_range (const char *filename, int from, int to)
if (file_size == 0)
{
free (input);
xfree (input);
close (file);
return 0; /* don't waste time if we don't have to */
}
+1 -1
View File
@@ -248,7 +248,7 @@ _hs_history_patsearch (const char *string, int direction, int flags)
ret = history_search_internal (pat, direction, flags|PATTERN_SEARCH);
if (pat != string)
free (pat);
xfree (pat);
return ret;
}
+2 -2
View File
@@ -679,7 +679,7 @@ opcode_dispatch:
paste = _rl_bracketed_text (&pastelen);
if (paste == 0 || *paste == 0)
{
free (paste);
xfree (paste);
break;
}
if (_rl_enable_active_region)
@@ -692,7 +692,7 @@ opcode_dispatch:
memcpy (cxt->search_string + cxt->search_string_index, paste, pastelen);
cxt->search_string_index += pastelen;
cxt->search_string[cxt->search_string_index] = '\0';
free (paste);
xfree (paste);
break;
/* Add character to search string and continue search. */
-11
View File
@@ -388,23 +388,12 @@ _rl_free_saved_history_line (void)
{
if (rl_undo_list && rl_undo_list == (UNDO_LIST *)_rl_saved_line_for_history->data)
rl_undo_list = 0;
/* Have to free this separately because _rl_free_history entry can't:
it doesn't know whether or not this has application data. Only the
callers that know this is _rl_saved_line_for_history can know that
it's an undo list. */
#if defined (HISTORY_SEARCH_SETS_HISTPOS)
if (_rl_saved_line_for_history->data)
{
orig = rl_undo_list;
rl_undo_list = (UNDO_LIST *)_rl_saved_line_for_history->data;
rl_free_undo_list ();
rl_undo_list = orig;
}
#else
if (_rl_saved_line_for_history->data)
_rl_free_undo_list ((UNDO_LIST *)_rl_saved_line_for_history->data);
#endif
_rl_free_history_entry (_rl_saved_line_for_history);
_rl_saved_line_for_history = (HIST_ENTRY *)NULL;
}
+1 -5
View File
@@ -492,12 +492,8 @@ readline_internal_teardown (int eof)
/* We don't want to do this if we executed functions that call
history_set_pos to set the history offset to the line containing the
non-incremental search string. */
#if defined (HISTORY_SEARCH_SETS_HISTPOS)
if (entry && rl_undo_list && _rl_history_search_pos != where_history ())
#else
if (entry && rl_undo_list)
#endif
{
{
temp = savestring (the_line);
rl_revert_line (1, 0);
entry = replace_history_entry (where_history (), the_line, (histdata_t)NULL);
+1 -40
View File
@@ -84,14 +84,12 @@ static int _rl_nsearch_dispatch (_rl_search_cxt *, int);
static void
make_history_line_current (HIST_ENTRY *entry)
{
#if !defined (HISTORY_SEARCH_SETS_HISTPOS)
UNDO_LIST *xlist;
xlist = _rl_saved_line_for_history ? (UNDO_LIST *)_rl_saved_line_for_history->data : 0;
/* At this point, rl_undo_list points to a private search string list. */
if (rl_undo_list && rl_undo_list != (UNDO_LIST *)entry->data && rl_undo_list != xlist)
rl_free_undo_list ();
#endif
/* Now we create a new undo list with a single insert for this text.
WE DON'T CHANGE THE ORIGINAL HISTORY ENTRY UNDO LIST */
@@ -106,7 +104,6 @@ make_history_line_current (HIST_ENTRY *entry)
rl_free_undo_list ();
#endif
#if !defined (HISTORY_SEARCH_SETS_HISTPOS)
/* This will need to free the saved undo list associated with the original
(pre-search) line buffer.
XXX - look at _rl_free_saved_history_line and consider calling it if
@@ -115,7 +112,6 @@ make_history_line_current (HIST_ENTRY *entry)
if (_rl_saved_line_for_history)
_rl_free_history_entry (_rl_saved_line_for_history);
_rl_saved_line_for_history = (HIST_ENTRY *)NULL;
#endif
}
/* Search the history list for STRING starting at absolute history position
@@ -204,10 +200,6 @@ noninc_dosearch (char *string, int dir, int flags)
history_set_pos (oldpos);
make_history_line_current (entry);
#if !defined (HISTORY_SEARCH_SETS_HISTPOS)
/* make_history_line_current used to do this. */
_rl_free_saved_history_line ();
#endif
if (_rl_enable_active_region && ((flags & SF_PATTERN) == 0) && ind > 0 && ind < rl_end)
{
@@ -538,20 +530,11 @@ rl_history_search_internal (int count, int dir)
{
HIST_ENTRY *temp;
int ret, oldpos, newcol;
UNDO_LIST *origlist;
int had_saved_line, origpos;
int had_saved_line;
char *t;
#if defined (HISTORY_SEARCH_SETS_HISTPOS)
origpos = where_history ();
had_saved_line = _rl_saved_line_for_history != 0;
rl_maybe_save_line ();
/* This will either be restored from the saved line or set from the
found history line. */
rl_undo_list = 0;
#else
rl_maybe_save_line ();
#endif
temp = (HIST_ENTRY *)NULL;
/* Search COUNT times through the history for a line matching
@@ -606,28 +589,6 @@ rl_history_search_internal (int count, int dir)
/* Copy the line we found into the current line buffer. */
make_history_line_current (temp);
/* XXX - can't make this work the way I want it to yet. Too much assumes
that rl_undo_list corresponds to the current history entry's undo list,
especially the stuff in maybe_save_line and especially maybe_replace_line.
Leaving it commented out for now. */
#if defined (HISTORY_SEARCH_SETS_HISTPOS)
/* Free the saved history line corresponding to the search string */
if (had_saved_line == 0)
_rl_free_saved_history_line ();
/* Make sure we set the current history position to the last line found so
we can do things like operate-and-get-next from here. This is similar to
how incremental search behaves. */
origlist = rl_undo_list;
rl_undo_list = 0; /* XXX - was (UNDO_LIST *)temp->data */
if (_rl_history_search_pos < origpos)
rl_get_previous_history (origpos - _rl_history_search_pos, 0);
else
rl_get_next_history (_rl_history_search_pos - origpos, 0);
rl_undo_list = origlist;
#endif
/* decide where to put rl_point -- need to change this for pattern search */
if (_rl_history_search_flags & ANCHORED_SEARCH)
rl_point = _rl_history_search_len; /* easy case */
+2 -2
View File
@@ -824,7 +824,7 @@ _rl_reset_region_color (int which, const char *value)
if (which == 0)
{
free (_rl_active_region_start_color);
xfree (_rl_active_region_start_color);
if (value && *value)
{
_rl_active_region_start_color = (char *)xmalloc (2 * strlen (value) + 1);
@@ -836,7 +836,7 @@ _rl_reset_region_color (int which, const char *value)
}
else
{
free (_rl_active_region_end_color);
xfree (_rl_active_region_end_color);
if (value && *value)
{
_rl_active_region_end_color = (char *)xmalloc (2 * strlen (value) + 1);