]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-5.2 patch 8: fix for quoting brackets inside array subscript expansion
authorChet Ramey <chet.ramey@case.edu>
Mon, 7 Nov 2022 16:43:33 +0000 (11:43 -0500)
committerChet Ramey <chet.ramey@case.edu>
Mon, 7 Nov 2022 16:43:33 +0000 (11:43 -0500)
patchlevel.h
subst.c

index b1897c5033310f6cc0b64ea294566eac6ed2702f..333dd9472f941499ea32147297e46aad4c9022d7 100644 (file)
@@ -25,6 +25,6 @@
    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
    looks for to find the patch level (for the sccs version string). */
 
-#define PATCHLEVEL 7
+#define PATCHLEVEL 8
 
 #endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index dcf2e46c2ea317cab1e81b74c080f88619f8f002..7715bfbf539fcdfb4fa5bda73c44a2fe1ce46daa 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -3819,6 +3819,10 @@ pos_params (string, start, end, quoted, pflags)
 #define EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~')
 #endif
 
+/* We don't perform process substitution in arithmetic expressions, so don't
+   bother checking for it. */
+#define ARITH_EXP_CHAR(s) (s == '$' || s == '`' || s == CTLESC || s == '~')
+
 /* If there are any characters in STRING that require full expansion,
    then call FUNC to expand STRING; otherwise just perform quote
    removal if necessary.  This returns a new string. */
@@ -4028,7 +4032,7 @@ expand_arith_string (string, quoted)
   i = saw_quote = 0;
   while (string[i])
     {
-      if (EXP_CHAR (string[i]))
+      if (ARITH_EXP_CHAR (string[i]))
        break;
       else if (string[i] == '\'' || string[i] == '\\' || string[i] == '"')
        saw_quote = string[i];