Bash-5.2 patch 24: fix problem with tilde expansion of values in compound associative array assignments

This commit is contained in:
Chet Ramey
2024-01-13 18:24:10 -05:00
parent c22ce0d04a
commit d1cf6ad908
3 changed files with 8 additions and 4 deletions
+3 -3
View 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)