subscripts if the shell compatibility level is greater than 51.
Prompted by report from Corey Hickey <bugfood-ml@fatooh.org>
+subst.c
+ - string_list_pos_params, param_expand: make sure that $* is treated
+ the same as "$*" in here-document bodies that are being expanded.
+ From https://lists.gnu.org/archive/html/bug-bash/2022-09/msg00002.html
+
11/1
----
lib/readline/readline.c
- push_posix_tempvar_internal: call arrayar_copyval instead of using
inline code
+ 6/19
+ ----
+lib/sh/shmatch.c
+ - sh_regmatch: use builtin_find_indexed_array to allow a local copy
+ of BASH_REMATCH.
+ From https://lists.gnu.org/archive/html/bug-bash/2022-05/msg00052.html
+
+execute_cmd.c
+ - execute_in_subshell: tentative change to clear procsub list after
+ performing redirections, so nothing in a redirection can affect
+ what's in the subshell.
+ From https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00114.html
+
+test.c
+ - binary_operator: in posix mode, the < and > operators compare strings
+ using the current locale (strcoll).
+ From https://www.austingroupbugs.net/view.php?id=375
+
+bashline.c
+ - bash_default_completion: make sure that command completion adds the
+ trailing `/' suffix for directories even if the directory name is
+ the same as the common prefix of matches.
+ From https://lists.gnu.org/archive/html/bug-bash/2022-11/msg00034.html
+
+lib/readline/kill.c
+ - rl_vi_yank_pop: make repeated invocations of vi-yank-pop cycle
+ through the kill ring just like in emacs mode, even when point
+ is at the end of the line.
+ From https://lists.gnu.org/archive/html/bug-bash/2022-08/msg00105.html
+
+parse.y
+ - parse_comsub: set variables if the last token (last_read_token) is
+ `;', `\n', or `&', in addition to was_word
+ - parse_comsub: if the last read token was a newline (was_newline),
+ terminate the comsub with a newline instead of a semicolon; keeps
+ the line numbers more consistent.
+ From a report by Grisha Levit <grishalevit@gmail.com>
+
+lib/sh/anonfile.c
+ - anonopen: use memfd_create if it is available, fall through to
+ traditional Unix/POSIX implementation if it fails
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
- 66. Command substitutions don't set the '?' special parameter. The
+ 66. The 'test' builtin compares strings using the current locale when
+ processing the '<' and '>' binary operators.
+
+ 67. Command substitutions don't set the '?' special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
rl_completion_suppress_append = 1;
rl_filename_completion_desired = 0;
}
-#if 0
- /* TAG:bash-5.3 jidanni@jidanni.org 11/11/2022 */
+#if 1
else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) &&
matches[2] && STREQ (matches[1], matches[2]) && CMD_IS_DIR (matches[0]))
#else
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
- 66. Command substitutions don't set the '?' special parameter. The
+ 66. The 'test' builtin compares strings using the current locale when
+ processing the '<' and '>' binary operators.
+
+ 67. Command substitutions don't set the '?' special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
Node: Controlling the Prompt\7f301070
Node: The Restricted Shell\7f304032
Node: Bash POSIX Mode\7f306639
-Node: Shell Compatibility Mode\7f322429
-Node: Job Control\7f330670
-Node: Job Control Basics\7f331127
-Node: Job Control Builtins\7f336126
-Node: Job Control Variables\7f341918
-Node: Command Line Editing\7f343071
-Node: Introduction and Notation\7f344739
-Node: Readline Interaction\7f346359
-Node: Readline Bare Essentials\7f347547
-Node: Readline Movement Commands\7f349333
-Node: Readline Killing Commands\7f350290
-Node: Readline Arguments\7f352208
-Node: Searching\7f353249
-Node: Readline Init File\7f355432
-Node: Readline Init File Syntax\7f356690
-Node: Conditional Init Constructs\7f380478
-Node: Sample Init File\7f384671
-Node: Bindable Readline Commands\7f387792
-Node: Commands For Moving\7f388993
-Node: Commands For History\7f391041
-Node: Commands For Text\7f396032
-Node: Commands For Killing\7f399678
-Node: Numeric Arguments\7f402708
-Node: Commands For Completion\7f403844
-Node: Keyboard Macros\7f408032
-Node: Miscellaneous Commands\7f408717
-Node: Readline vi Mode\7f414752
-Node: Programmable Completion\7f415656
-Node: Programmable Completion Builtins\7f423433
-Node: A Programmable Completion Example\7f434550
-Node: Using History Interactively\7f439795
-Node: Bash History Facilities\7f440476
-Node: Bash History Builtins\7f443478
-Node: History Interaction\7f448499
-Node: Event Designators\7f452116
-Node: Word Designators\7f453467
-Node: Modifiers\7f455224
-Node: Installing Bash\7f457029
-Node: Basic Installation\7f458163
-Node: Compilers and Options\7f461882
-Node: Compiling For Multiple Architectures\7f462620
-Node: Installation Names\7f464309
-Node: Specifying the System Type\7f466415
-Node: Sharing Defaults\7f467129
-Node: Operation Controls\7f467799
-Node: Optional Features\7f468754
-Node: Reporting Bugs\7f479970
-Node: Major Differences From The Bourne Shell\7f481301
-Node: GNU Free Documentation License\7f498147
-Node: Indexes\7f523321
-Node: Builtin Index\7f523772
-Node: Reserved Word Index\7f530870
-Node: Variable Index\7f533315
-Node: Function Index\7f550446
-Node: Concept Index\7f564227
+Node: Shell Compatibility Mode\7f322552
+Node: Job Control\7f330793
+Node: Job Control Basics\7f331250
+Node: Job Control Builtins\7f336249
+Node: Job Control Variables\7f342041
+Node: Command Line Editing\7f343194
+Node: Introduction and Notation\7f344862
+Node: Readline Interaction\7f346482
+Node: Readline Bare Essentials\7f347670
+Node: Readline Movement Commands\7f349456
+Node: Readline Killing Commands\7f350413
+Node: Readline Arguments\7f352331
+Node: Searching\7f353372
+Node: Readline Init File\7f355555
+Node: Readline Init File Syntax\7f356813
+Node: Conditional Init Constructs\7f380601
+Node: Sample Init File\7f384794
+Node: Bindable Readline Commands\7f387915
+Node: Commands For Moving\7f389116
+Node: Commands For History\7f391164
+Node: Commands For Text\7f396155
+Node: Commands For Killing\7f399801
+Node: Numeric Arguments\7f402831
+Node: Commands For Completion\7f403967
+Node: Keyboard Macros\7f408155
+Node: Miscellaneous Commands\7f408840
+Node: Readline vi Mode\7f414875
+Node: Programmable Completion\7f415779
+Node: Programmable Completion Builtins\7f423556
+Node: A Programmable Completion Example\7f434673
+Node: Using History Interactively\7f439918
+Node: Bash History Facilities\7f440599
+Node: Bash History Builtins\7f443601
+Node: History Interaction\7f448622
+Node: Event Designators\7f452239
+Node: Word Designators\7f453590
+Node: Modifiers\7f455347
+Node: Installing Bash\7f457152
+Node: Basic Installation\7f458286
+Node: Compilers and Options\7f462005
+Node: Compiling For Multiple Architectures\7f462743
+Node: Installation Names\7f464432
+Node: Specifying the System Type\7f466538
+Node: Sharing Defaults\7f467252
+Node: Operation Controls\7f467922
+Node: Optional Features\7f468877
+Node: Reporting Bugs\7f480093
+Node: Major Differences From The Bourne Shell\7f481424
+Node: GNU Free Documentation License\7f498270
+Node: Indexes\7f523444
+Node: Builtin Index\7f523895
+Node: Reserved Word Index\7f530993
+Node: Variable Index\7f533438
+Node: Function Index\7f550569
+Node: Concept Index\7f564350
\1f
End Tag Table
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
- 66. Command substitutions don't set the '?' special parameter. The
+ 66. The 'test' builtin compares strings using the current locale when
+ processing the '<' and '>' binary operators.
+
+ 67. Command substitutions don't set the '?' special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
Node: Controlling the Prompt\7f301295
Node: The Restricted Shell\7f304260
Node: Bash POSIX Mode\7f306870
-Node: Shell Compatibility Mode\7f322663
-Node: Job Control\7f330907
-Node: Job Control Basics\7f331367
-Node: Job Control Builtins\7f336369
-Node: Job Control Variables\7f342164
-Node: Command Line Editing\7f343320
-Node: Introduction and Notation\7f344991
-Node: Readline Interaction\7f346614
-Node: Readline Bare Essentials\7f347805
-Node: Readline Movement Commands\7f349594
-Node: Readline Killing Commands\7f350554
-Node: Readline Arguments\7f352475
-Node: Searching\7f353519
-Node: Readline Init File\7f355705
-Node: Readline Init File Syntax\7f356966
-Node: Conditional Init Constructs\7f380757
-Node: Sample Init File\7f384953
-Node: Bindable Readline Commands\7f388077
-Node: Commands For Moving\7f389281
-Node: Commands For History\7f391332
-Node: Commands For Text\7f396326
-Node: Commands For Killing\7f399975
-Node: Numeric Arguments\7f403008
-Node: Commands For Completion\7f404147
-Node: Keyboard Macros\7f408338
-Node: Miscellaneous Commands\7f409026
-Node: Readline vi Mode\7f415064
-Node: Programmable Completion\7f415971
-Node: Programmable Completion Builtins\7f423751
-Node: A Programmable Completion Example\7f434871
-Node: Using History Interactively\7f440119
-Node: Bash History Facilities\7f440803
-Node: Bash History Builtins\7f443808
-Node: History Interaction\7f448832
-Node: Event Designators\7f452452
-Node: Word Designators\7f453806
-Node: Modifiers\7f455566
-Node: Installing Bash\7f457374
-Node: Basic Installation\7f458511
-Node: Compilers and Options\7f462233
-Node: Compiling For Multiple Architectures\7f462974
-Node: Installation Names\7f464666
-Node: Specifying the System Type\7f466775
-Node: Sharing Defaults\7f467492
-Node: Operation Controls\7f468165
-Node: Optional Features\7f469123
-Node: Reporting Bugs\7f480342
-Node: Major Differences From The Bourne Shell\7f481676
-Node: GNU Free Documentation License\7f498525
-Node: Indexes\7f523702
-Node: Builtin Index\7f524156
-Node: Reserved Word Index\7f531257
-Node: Variable Index\7f533705
-Node: Function Index\7f550839
-Node: Concept Index\7f564623
+Node: Shell Compatibility Mode\7f322786
+Node: Job Control\7f331030
+Node: Job Control Basics\7f331490
+Node: Job Control Builtins\7f336492
+Node: Job Control Variables\7f342287
+Node: Command Line Editing\7f343443
+Node: Introduction and Notation\7f345114
+Node: Readline Interaction\7f346737
+Node: Readline Bare Essentials\7f347928
+Node: Readline Movement Commands\7f349717
+Node: Readline Killing Commands\7f350677
+Node: Readline Arguments\7f352598
+Node: Searching\7f353642
+Node: Readline Init File\7f355828
+Node: Readline Init File Syntax\7f357089
+Node: Conditional Init Constructs\7f380880
+Node: Sample Init File\7f385076
+Node: Bindable Readline Commands\7f388200
+Node: Commands For Moving\7f389404
+Node: Commands For History\7f391455
+Node: Commands For Text\7f396449
+Node: Commands For Killing\7f400098
+Node: Numeric Arguments\7f403131
+Node: Commands For Completion\7f404270
+Node: Keyboard Macros\7f408461
+Node: Miscellaneous Commands\7f409149
+Node: Readline vi Mode\7f415187
+Node: Programmable Completion\7f416094
+Node: Programmable Completion Builtins\7f423874
+Node: A Programmable Completion Example\7f434994
+Node: Using History Interactively\7f440242
+Node: Bash History Facilities\7f440926
+Node: Bash History Builtins\7f443931
+Node: History Interaction\7f448955
+Node: Event Designators\7f452575
+Node: Word Designators\7f453929
+Node: Modifiers\7f455689
+Node: Installing Bash\7f457497
+Node: Basic Installation\7f458634
+Node: Compilers and Options\7f462356
+Node: Compiling For Multiple Architectures\7f463097
+Node: Installation Names\7f464789
+Node: Specifying the System Type\7f466898
+Node: Sharing Defaults\7f467615
+Node: Operation Controls\7f468288
+Node: Optional Features\7f469246
+Node: Reporting Bugs\7f480465
+Node: Major Differences From The Bourne Shell\7f481799
+Node: GNU Free Documentation License\7f498648
+Node: Indexes\7f523825
+Node: Builtin Index\7f524279
+Node: Reserved Word Index\7f531380
+Node: Variable Index\7f533828
+Node: Function Index\7f550962
+Node: Concept Index\7f564746
\1f
End Tag Table
That means, for example, that a backslash preceding a double quote
character will escape it and the backslash will be removed.
+@item
+The @code{test} builtin compares strings using the current locale when
+processing the @samp{<} and @samp{>} binary operators.
+
@item
Command substitutions don't set the @samp{?} special parameter. The exit
status of a simple command without a command word is still the exit status
dispose_redirects (command->redirects);
command->redirects = (REDIRECT *)NULL;
-#if 0
+#if 1
#if defined (PROCESS_SUBSTITUTION) && defined (JOB_CONTROL)
- /* TAG: bash-5.3 kre 10/24/2022 */
if (user_subshell && command->type == cm_subshell)
{
procsub_clear ();
}
l = strlen (rl_kill_ring[rl_kill_index]);
-#if 0 /* TAG:readline-8.3 8/29/2022 matteopaolini1995@gmail.com */
+#if 1
origpoint = rl_point;
n = rl_point - l + 1;
#else
#endif
if (n >= 0 && STREQN (rl_line_buffer + n, rl_kill_ring[rl_kill_index], l))
{
-#if 0 /* TAG:readline-8.3 */
+#if 1
rl_delete_text (n, n + l); /* remember vi cursor positioning */
rl_point = origpoint - l;
#else
{
int fd, flag;
+#if defined (HAVE_MEMFD_CREATE)
+ /* "Names do not affect the behavior of the file descriptor." */
+ fd = memfd_create ("anonopen", 0);
+ if (fd >= 0)
+ return fd;
+ /* If memfd_create fails, we fall through to the unlinked-regular-file
+ implementation. */
+#endif
+
/* Heuristic */
flag = (name && *name == '/') ? MT_TEMPLATE : MT_USETMPDIR;
fd = sh_mktmpfd (name, flag|MT_USERANDOM|MT_READWRITE|MT_UNLINK, fn);
/* Store the parenthesized subexpressions in the array BASH_REMATCH.
Element 0 is the portion that matched the entire regexp. Element 1
is the part that matched the first subexpression, and so on. */
-#if 1
+#if 0
+ /* This was the pre-bash-5.3 code. */
unbind_global_variable_noref ("BASH_REMATCH");
rematch = make_new_array_variable ("BASH_REMATCH");
#else
- /* TAG:bash-5.3 */
rematch = builtin_find_indexed_array ("BASH_REMATCH", 1);
#endif
amatch = rematch ? array_cell (rematch) : (ARRAY *)0;
parse_comsub (int qc, int open, int close, size_t *lenp, int flags)
{
int peekc, r;
- int start_lineno, dolbrace_spec, local_extglob, was_extpat, was_word;
+ int start_lineno, dolbrace_spec, local_extglob, was_extpat;
+ int was_word, was_newline, was_semi, was_amp;
char *ret, *tcmd;
size_t retlen;
sh_parser_state_t ps;
save_parser_state (&ps);
was_extpat = (parser_state & PST_EXTPAT);
- was_word = 0;
+ was_word = was_newline = was_semi = was_amp = 0;
/* State flags we don't want to persist into command substitutions. */
parser_state &= ~(PST_REGEXP|PST_EXTPAT|PST_CONDCMD|PST_CONDEXPR|PST_COMPASSIGN);
if (open == '{')
{
- if (current_token == shell_eof_token &&
- (last_read_token == ';' || last_read_token == '\n') &&
- (token_before_that == WORD || token_before_that == ASSIGNMENT_WORD))
- was_word = 1;
+ if (current_token == shell_eof_token)
+ {
+ was_semi = last_read_token == ';';
+ was_newline = last_read_token == '\n';
+ was_amp = last_read_token == '&';
+
+ was_word = (was_semi || was_newline) && (token_before_that == WORD || token_before_that == ASSIGNMENT_WORD);
+ }
}
if (need_here_doc > 0)
ret = xmalloc (retlen + 4);
ret[0] = (dolbrace_spec == '|') ? '|' : ' ';
strcpy (ret + 1, tcmd); /* ( */
- if (was_word)
+ if (was_newline)
+ ret[retlen++] = '\n';
+ else if (was_word || was_semi)
ret[retlen++] = ';';
else if (lastc != '\n' && lastc != ';' && lastc != '&')
ret[retlen++] = ';';
{
tlist = quote_list (list);
word_list_remove_quoted_nulls (tlist);
-#if 0
- ret = string_list (tlist);
-#else
- /* TAG:bash-5.3 Aloxaf Yin 9/1/2022 */
ret = string_list_dollar_star (tlist, 0, 0);
-#endif
}
else if (pchar == '*' && quoted == 0 && ifs_is_null) /* XXX */
ret = expand_no_split_dollar_star ? string_list_dollar_star (list, quoted, 0) : string_list_dollar_at (list, quoted, 0); /* Posix interp 888 */
quote the whole string, including the separators. If IFS
is unset, the parameters are separated by ' '; if $IFS is
null, the parameters are concatenated. */
-#if 0
- temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list, quoted, 0) : string_list (list);
-#else
- /* TAG:bash-5.3 Aloxaf Yin 9/1/2022 */
temp = string_list_dollar_star (list, quoted, 0);
-#endif
if (temp)
{
temp1 = (quoted & Q_DOUBLE_QUOTES) ? quote_string (temp) : temp;
((w[0] == '>' || w[0] == '<') && w[1] == '\0') || /* <, > */
(w[0] == '!' && w[1] == '=' && w[2] == '\0')) /* != */
{
-#if 0 /* TAG: bash-5.3 POSIX interp 375 11/9/2022 */
+#if 1 /* POSIX interp 375 11/9/2022 */
value = binary_test (w, argv[pos], argv[pos + 2], (posixly_correct ? TEST_LOCALE : 0));
#else
value = binary_test (w, argv[pos], argv[pos + 2], 0);