fix minor mem leaks; fix problem with parser state during a DEBUG trap with -T enabled in a shell function; fix crash with propagating array variables; fix overflow in compound array appending

This commit is contained in:
Chet Ramey
2023-06-28 14:48:09 -04:00
parent 829aad36db
commit fa98070927
15 changed files with 557 additions and 399 deletions
+27 -23
View File
@@ -856,18 +856,20 @@ PPAARRAAMMEETTEERRSS
tion to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the
shell has started to execute a script, or referencing this vari-
able when eexxttddeebbuugg is not set, may result in inconsistent val-
ues.
ues. Assignments to BBAASSHH__AARRGGCC have no effect, and it may not be
unset.
BBAASSHH__AARRGGVV
An array variable containing all of the parameters in the cur-
An array variable containing all of the parameters in the cur-
rent bbaasshh execution call stack. The final parameter of the last
subroutine call is at the top of the stack; the first parameter
subroutine call is at the top of the stack; the first parameter
of the initial call is at the bottom. When a subroutine is exe-
cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The
shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see
the description of the eexxttddeebbuugg option to the sshhoopptt builtin be-
cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The
shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see
the description of the eexxttddeebbuugg option to the sshhoopptt builtin be-
low). Setting eexxttddeebbuugg after the shell has started to execute a
script, or referencing this variable when eexxttddeebbuugg is not set,
may result in inconsistent values.
script, or referencing this variable when eexxttddeebbuugg is not set,
may result in inconsistent values. Assignments to BBAASSHH__AARRGGVV
have no effect, and it may not be unset.
BBAASSHH__AARRGGVV00
When referenced, this variable expands to the name of the shell
or shell script (identical to $$00; see the description of special
@@ -896,29 +898,31 @@ PPAARRAAMMEETTEERRSS
$${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file
($${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}) where $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or
$${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func-
tion). Use LLIINNEENNOO to obtain the current line number.
tion). Use LLIINNEENNOO to obtain the current line number. Assign-
ments to BBAASSHH__LLIINNEENNOO have no effect, and it may not be unset.
BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH
A colon-separated list of directories in which the shell looks
for dynamically loadable builtins specified by the eennaabbllee com-
A colon-separated list of directories in which the shell looks
for dynamically loadable builtins specified by the eennaabbllee com-
mand.
BBAASSHH__RREEMMAATTCCHH
An array variable whose members are assigned by the ==~~ binary
operator to the [[[[ conditional command. The element with index
0 is the portion of the string matching the entire regular ex-
An array variable whose members are assigned by the ==~~ binary
operator to the [[[[ conditional command. The element with index
0 is the portion of the string matching the entire regular ex-
pression. The element with index _n is the portion of the string
matching the _nth parenthesized subexpression.
BBAASSHH__MMOONNOOSSEECCOONNDDSS
Each time this variable is referenced, it expands to the value
returned by the system's monotonic clock, if one is available.
If there is no monotonic clock, this is equivalent to EEPPOOCCHHSSEECC--
OONNDDSS. If BBAASSHH__MMOONNOOSSEECCOONNDDSS is unset, it loses its special prop-
Each time this variable is referenced, it expands to the value
returned by the system's monotonic clock, if one is available.
If there is no monotonic clock, this is equivalent to EEPPOOCCHHSSEECC--
OONNDDSS. If BBAASSHH__MMOONNOOSSEECCOONNDDSS is unset, it loses its special prop-
erties, even if it is subsequently reset.
BBAASSHH__SSOOUURRCCEE
An array variable whose members are the source filenames where
the corresponding shell function names in the FFUUNNCCNNAAMMEE array
An array variable whose members are the source filenames where
the corresponding shell function names in the FFUUNNCCNNAAMMEE array
variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is de-
fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from
$${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}.
fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from
$${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. Assignments to BBAASSHH__SSOOUURRCCEE have no ef-
fect, and it may not be unset.
BBAASSHH__SSUUBBSSHHEELLLL
Incremented by one within each subshell or subshell environment
when the shell begins executing in that environment. The ini-
@@ -6795,4 +6799,4 @@ BBUUGGSS
GNU Bash 5.3 2023 June 16 BASH(1)
GNU Bash 5.3 2023 June 28 BASH(1)