Bash-5.2-rc4 release

This commit is contained in:
Chet Ramey
2022-09-09 16:44:32 -04:00
parent b3afafd86d
commit 9cef6d0118
17 changed files with 4144 additions and 39 deletions
+17
View File
@@ -1,3 +1,20 @@
This document details the changes between this version, bash-5.2-rc4, and
the previous version, bash-5.2-rc3.
1. Changes to Bash
a. Changed how the compatibility mode enabling of extglob works in conjunction
with parsing conditional commands.
b. Fixed a problem with aliases containing command substitutions.
2. Changes to Readline
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-rc3, and
the previous version, bash-5.2-rc2.
+17
View File
@@ -1,3 +1,20 @@
This document details the changes between this version, bash-5.2-rc4, and
the previous version, bash-5.2-rc3.
1. Changes to Bash
a. Changed how the compatibility mode enabling of extglob works in conjunction
with parsing conditional commands.
b. Fixed a problem with aliases containing command substitutions.
2. Changes to Readline
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-rc3, and
the previous version, bash-5.2-rc2.
+36 -1
View File
@@ -3904,4 +3904,39 @@ builtins/exec.def
command is not found by search_for_command. Report and fix from
Xiami <i@f2light.com>
[bash-5.2-rc3 frozen]
8/27
----
parse.y
- parse_comsub: restore extended_glob to a local copy (local_extglob)
only if we changed it; a safer way to do it. Fixes extglob change
issue reported by Kerin Millar <kfm@plushkava.net>
- cond_term: restore extended_glob to a local copy; safer than using
global_extglob, which we will reserve for error recovery
8/30
----
parse.y
- parse_comsub: don't clear the pushed string list; we might need it to
consume additional input to satisfy this command substitution. When
we restore the parser state, don't restore the pushed string list in
case we used it. From
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018727
- parse_comsub: don't modify extended_glob if parser_state includes
PST_EXTPAT, in which case we've already set extended_glob and
global_extglob appropriately. Only matters in compatibility mode.
8/31
----
subst.c
- parameter_brace_transform: make sure we return an error if *xform
is '\0'. Report from Ivan Kapranov <koltiradw@yandex.ru>
9/7
---
[bump version to bash-5.2-rc4]
9/8
---
[bash-5.2-rc4 frozen]
-1
View File
@@ -1 +0,0 @@
CWRU/changelog
+3942
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -41,7 +41,7 @@ support d
tests d
tests/misc d
ABOUT-NLS f
ChangeLog s CWRU/changelog
ChangeLog c CWRU/changelog
CHANGES f
COMPAT f
COPYING f
@@ -1002,6 +1002,7 @@ tests/comsub2.sub f
tests/comsub3.sub f
tests/comsub4.sub f
tests/comsub5.sub f
tests/comsub6.sub f
tests/comsub-eof.tests f
tests/comsub-eof0.sub f
tests/comsub-eof1.sub f
Vendored
+11 -11
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac for Bash 5.2, version 5.044.
# From configure.ac for Bash 5.2, version 5.045.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for bash 5.2-rc3.
# Generated by GNU Autoconf 2.71 for bash 5.2-rc4.
#
# 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-rc3'
PACKAGE_STRING='bash 5.2-rc3'
PACKAGE_VERSION='5.2-rc4'
PACKAGE_STRING='bash 5.2-rc4'
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-rc3 to adapt to many kinds of systems.
\`configure' configures bash 5.2-rc4 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-rc3:";;
short | recursive ) echo "Configuration of bash 5.2-rc4:";;
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-rc3
bash configure 5.2-rc4
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-rc3, which was
It was created by bash $as_me 5.2-rc4, 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=rc3
RELSTATUS=rc4
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|releng*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -22369,7 +22369,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-rc3, which was
This file was extended by bash $as_me 5.2-rc4, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22437,7 +22437,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-rc3
bash config.status 5.2-rc4
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
+2 -2
View File
@@ -21,10 +21,10 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 5.2, version 5.044])dnl
AC_REVISION([for Bash 5.2, version 5.045])dnl
define(bashvers, 5.2)
define(relstatus, rc3)
define(relstatus, rc4)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
+11 -1
View File
@@ -559,7 +559,7 @@ rl_yank_pop (int count, int key)
int
rl_vi_yank_pop (int count, int key)
{
int l, n;
int l, n, origpoint;
if (((rl_last_func != rl_vi_yank_pop) && (rl_last_func != rl_vi_put)) ||
!rl_kill_ring)
@@ -569,11 +569,21 @@ rl_vi_yank_pop (int count, int key)
}
l = strlen (rl_kill_ring[rl_kill_index]);
#if 0 /* TAG:readline-8.3 8/29/2022 matteopaolini1995@gmail.com */
origpoint = rl_point;
n = rl_point - l + 1;
#else
n = rl_point - l;
#endif
if (n >= 0 && STREQN (rl_line_buffer + n, rl_kill_ring[rl_kill_index], l))
{
#if 0 /* TAG:readline-8.3 */
rl_delete_text (n, n + l); /* remember vi cursor positioning */
rl_point = origpoint - l;
#else
rl_delete_text (n, rl_point);
rl_point = n;
#endif
rl_kill_index--;
if (rl_kill_index < 0)
rl_kill_index = rl_kill_ring_length - 1;
+24 -10
View File
@@ -4063,10 +4063,11 @@ parse_comsub (qc, open, close, lenp, flags)
int *lenp, flags;
{
int peekc, r;
int start_lineno;
int start_lineno, local_extglob, was_extpat;
char *ret, *tcmd;
int retlen;
sh_parser_state_t ps;
STRING_SAVER *saved_strings;
COMMAND *saved_global, *parsed_command;
/* Posix interp 217 says arithmetic expressions have precedence, so
@@ -4086,7 +4087,7 @@ parse_comsub (qc, open, close, lenp, flags)
save_parser_state (&ps);
pushed_string_list = (STRING_SAVER *)NULL;
was_extpat = (parser_state & PST_EXTPAT);
/* State flags we don't want to persist into command substitutions. */
parser_state &= ~(PST_REGEXP|PST_EXTPAT|PST_CONDCMD|PST_CONDEXPR|PST_COMPASSIGN);
@@ -4098,6 +4099,8 @@ parse_comsub (qc, open, close, lenp, flags)
/* State flags we want to set for this run through the parser. */
parser_state |= PST_CMDSUBST|PST_EOFTOKEN|PST_NOEXPAND;
/* leave pushed_string_list alone, since we might need to consume characters
from it to satisfy this command substitution (in some perverse case). */
shell_eof_token = close;
saved_global = global_command; /* might not be necessary */
@@ -4114,9 +4117,13 @@ parse_comsub (qc, open, close, lenp, flags)
if (expand_aliases)
expand_aliases = posixly_correct != 0;
#if defined (EXTENDED_GLOB)
global_extglob = extended_glob;
if (shell_compatibility_level <= 51)
extended_glob = 1;
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
conditional command and have already set global_extglob appropriately. */
if (shell_compatibility_level <= 51 && was_extpat == 0)
{
local_extglob = global_extglob = extended_glob;
extended_glob = 1;
}
#endif
current_token = '\n'; /* XXX */
@@ -4131,7 +4138,8 @@ parse_comsub (qc, open, close, lenp, flags)
}
#if defined (EXTENDED_GLOB)
extended_glob = global_extglob;
if (shell_compatibility_level <= 51 && was_extpat == 0)
extended_glob = local_extglob;
#endif
parsed_command = global_command;
@@ -4158,7 +4166,7 @@ parse_comsub (qc, open, close, lenp, flags)
shell_eof_token = ps.eof_token;
expand_aliases = ps.expand_aliases;
jump_to_top_level (DISCARD);
jump_to_top_level (DISCARD); /* XXX - return (&matched_pair_error)? */
}
}
@@ -4177,7 +4185,12 @@ INTERNAL_DEBUG(("current_token (%d) != shell_eof_token (%c)", current_token, she
return (&matched_pair_error);
}
/* We don't want to restore the old pushed string list, since we might have
used it to consume additional input from an alias while parsing this
command substitution. */
saved_strings = pushed_string_list;
restore_parser_state (&ps);
pushed_string_list = saved_strings;
tcmd = print_comsub (parsed_command); /* returns static memory */
retlen = strlen (tcmd);
@@ -4259,7 +4272,7 @@ xparse_dolparen (base, string, indp, flags)
old value will be restored by restore_parser_state(). */
expand_aliases = 0;
#if defined (EXTENDED_GLOB)
global_extglob = extended_glob;
global_extglob = extended_glob; /* for reset_parser() */
#endif
token_to_read = DOLPAREN; /* let's trick the parser */
@@ -4597,7 +4610,7 @@ cond_term ()
{
WORD_DESC *op;
COND_COM *term, *tleft, *tright;
int tok, lineno;
int tok, lineno, local_extglob;
char *etext;
/* Read a token. It can be a left paren, a `!', a unary operator, or a
@@ -4711,11 +4724,12 @@ cond_term ()
}
/* rhs */
local_extglob = extended_glob;
if (parser_state & PST_EXTPAT)
extended_glob = 1;
tok = read_token (READ);
if (parser_state & PST_EXTPAT)
extended_glob = global_extglob;
extended_glob = local_extglob;
parser_state &= ~(PST_REGEXP|PST_EXTPAT);
if (tok == WORD)
+1 -1
View File
@@ -8660,7 +8660,7 @@ parameter_brace_transform (varname, value, estatep, xform, rtype, quoted, pflags
return ((char *)NULL);
}
if (valid_parameter_transform (xform) == 0)
if (xform[0] == 0 || valid_parameter_transform (xform) == 0)
{
this_command_name = oname;
if (vtype == VT_VARIABLE)
+11
View File
@@ -66,3 +66,14 @@ ok 7
ok 9
ok 8
ok 8
Mon Aug 29 20:03:02 EDT 2022
post foo
Mon Aug 29 20:03:02 EDT 2022
post foo1
Mon Aug 29 20:03:02 EDT 2022
Mon Aug 29 20:03:02 EDT 2022 after
7
Mon Aug 29 20:03:02 EDT 2022
hey after x
./comsub6.sub: line 40: syntax error near unexpected token `)'
./comsub6.sub: line 40: `math1)'
+1
View File
@@ -81,3 +81,4 @@ ${THIS_SH} ./comsub2.sub
${THIS_SH} ./comsub3.sub
${THIS_SH} ./comsub4.sub
${THIS_SH} ./comsub5.sub
${THIS_SH} ./comsub6.sub
+40
View File
@@ -0,0 +1,40 @@
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
DATE='Mon Aug 29 20:03:02 EDT 2022'
shopt -s expand_aliases
alias foo='echo $(echo $DATE)'
alias foo1='echo $(echo $DATE) '
foo
echo post foo
foo1
echo post foo1
alias comsub0='echo $(echo $DATE'
comsub0)
comsub0 ) after
alias math0='echo $(( 4+3 )'
math0)
alias x='VAR=$(echo hey)'
x
foo
echo $VAR after x
alias math1='echo $( date )'
math1)
+1
View File
@@ -648,6 +648,7 @@ i
declare -i foo
A
declare -A foo
./new-exp10.sub: line 118: ${V@}: bad substitution
abcxxxdef
abcådef
ḅć
+3
View File
@@ -113,3 +113,6 @@ declare -A foo
echo ${foo@a}
declare -p foo
V=42
echo ${V@} # error
+1 -1
View File
@@ -12,7 +12,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# test the other uses of the 'K' tranform operator and its sibling 'k'
# test the other uses of the 'K' transform operator and its sibling 'k'
# the associative array tests are performed separately, since that was the
# original motivation for this feature
foo=string
+24 -10
View File
@@ -6374,10 +6374,11 @@ parse_comsub (qc, open, close, lenp, flags)
int *lenp, flags;
{
int peekc, r;
int start_lineno;
int start_lineno, local_extglob, was_extpat;
char *ret, *tcmd;
int retlen;
sh_parser_state_t ps;
STRING_SAVER *saved_strings;
COMMAND *saved_global, *parsed_command;
/* Posix interp 217 says arithmetic expressions have precedence, so
@@ -6397,7 +6398,7 @@ parse_comsub (qc, open, close, lenp, flags)
save_parser_state (&ps);
pushed_string_list = (STRING_SAVER *)NULL;
was_extpat = (parser_state & PST_EXTPAT);
/* State flags we don't want to persist into command substitutions. */
parser_state &= ~(PST_REGEXP|PST_EXTPAT|PST_CONDCMD|PST_CONDEXPR|PST_COMPASSIGN);
@@ -6409,6 +6410,8 @@ parse_comsub (qc, open, close, lenp, flags)
/* State flags we want to set for this run through the parser. */
parser_state |= PST_CMDSUBST|PST_EOFTOKEN|PST_NOEXPAND;
/* leave pushed_string_list alone, since we might need to consume characters
from it to satisfy this command substitution (in some perverse case). */
shell_eof_token = close;
saved_global = global_command; /* might not be necessary */
@@ -6425,9 +6428,13 @@ parse_comsub (qc, open, close, lenp, flags)
if (expand_aliases)
expand_aliases = posixly_correct != 0;
#if defined (EXTENDED_GLOB)
global_extglob = extended_glob;
if (shell_compatibility_level <= 51)
extended_glob = 1;
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
conditional command and have already set global_extglob appropriately. */
if (shell_compatibility_level <= 51 && was_extpat == 0)
{
local_extglob = global_extglob = extended_glob;
extended_glob = 1;
}
#endif
current_token = '\n'; /* XXX */
@@ -6442,7 +6449,8 @@ parse_comsub (qc, open, close, lenp, flags)
}
#if defined (EXTENDED_GLOB)
extended_glob = global_extglob;
if (shell_compatibility_level <= 51 && was_extpat == 0)
extended_glob = local_extglob;
#endif
parsed_command = global_command;
@@ -6469,7 +6477,7 @@ parse_comsub (qc, open, close, lenp, flags)
shell_eof_token = ps.eof_token;
expand_aliases = ps.expand_aliases;
jump_to_top_level (DISCARD);
jump_to_top_level (DISCARD); /* XXX - return (&matched_pair_error)? */
}
}
@@ -6488,7 +6496,12 @@ INTERNAL_DEBUG(("current_token (%d) != shell_eof_token (%c)", current_token, she
return (&matched_pair_error);
}
/* We don't want to restore the old pushed string list, since we might have
used it to consume additional input from an alias while parsing this
command substitution. */
saved_strings = pushed_string_list;
restore_parser_state (&ps);
pushed_string_list = saved_strings;
tcmd = print_comsub (parsed_command); /* returns static memory */
retlen = strlen (tcmd);
@@ -6570,7 +6583,7 @@ xparse_dolparen (base, string, indp, flags)
old value will be restored by restore_parser_state(). */
expand_aliases = 0;
#if defined (EXTENDED_GLOB)
global_extglob = extended_glob;
global_extglob = extended_glob; /* for reset_parser() */
#endif
token_to_read = DOLPAREN; /* let's trick the parser */
@@ -6908,7 +6921,7 @@ cond_term ()
{
WORD_DESC *op;
COND_COM *term, *tleft, *tright;
int tok, lineno;
int tok, lineno, local_extglob;
char *etext;
/* Read a token. It can be a left paren, a `!', a unary operator, or a
@@ -7022,11 +7035,12 @@ cond_term ()
}
/* rhs */
local_extglob = extended_glob;
if (parser_state & PST_EXTPAT)
extended_glob = 1;
tok = read_token (READ);
if (parser_state & PST_EXTPAT)
extended_glob = global_extglob;
extended_glob = local_extglob;
parser_state &= ~(PST_REGEXP|PST_EXTPAT);
if (tok == WORD)