]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-5.2 patch 24: fix problem with tilde expansion of values in compound associative...
authorChet Ramey <chet.ramey@case.edu>
Sat, 13 Jan 2024 23:24:10 +0000 (18:24 -0500)
committerChet Ramey <chet.ramey@case.edu>
Sat, 13 Jan 2024 23:24:10 +0000 (18:24 -0500)
arrayfunc.c
patchlevel.h
subst.c

index 2c05d15b45f7dd91d84ff6354f26b78d967e20b7..412562276df315057549bcf89ef48c409c44bea0 100644 (file)
@@ -650,7 +650,7 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
          continue;
        }             
 
-      aval = expand_subscript_string (v, 0);
+      aval = expand_assignment_string_to_string (v, 0);
       if (aval == 0)
        {
          aval = (char *)xmalloc (1);
@@ -842,7 +842,7 @@ assign_compound_array_list (var, nlist, flags)
       /* See above; we need to expand the value here */
       if (assoc_p (var))
        {
-         val = expand_subscript_string (val, 0);
+         val = expand_assignment_string_to_string (val, 0);
          if (val == 0)
            {
              val = (char *)xmalloc (1);
@@ -1030,7 +1030,7 @@ expand_and_quote_assoc_word (w, type)
     nword[i++] = w[ind++];
   nword[i++] = w[ind++];
 
-  t = expand_subscript_string (w+ind, 0);
+  t = expand_assignment_string_to_string (w+ind, 0);
   s = (t && strchr (t, CTLESC)) ? quote_escapes (t) : t;
   value = sh_single_quote (s ? s : "");
   if (s != t)
index fb4c70c018e121c3a47d1a60f539638f18a4a45c..a88aa72e9d3d49e9457f81be57bb598ead20a367 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 23
+#define PATCHLEVEL 24
 
 #endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 0dfabfea9a17bf7b23af2859cea88cc62e3c39f6..2012e1fd9e3412740a3eae8c6a17e5f3d5c7b959 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -10802,7 +10802,11 @@ expand_subscript_string (string, quoted)
   oe = expand_no_split_dollar_star;
   ret = (char *)NULL;
 
+#if 0
   td.flags = W_NOPROCSUB|W_NOTILDE|W_NOSPLIT2; /* XXX - W_NOCOMSUB? */
+#else
+  td.flags = W_NOPROCSUB|W_NOSPLIT2;   /* XXX - W_NOCOMSUB? */
+#endif
   td.word = savestring (string);               /* in case it's freed on error */
 
   expand_no_split_dollar_star = 1;