fixed a bug with expanding unquoted $* when the separator is not whitespace and one or more of the positional parameters ends with the separator, resulting in an extra blank field being generated; fixed an issue with adjusting SHLVL in subshells that caused the environment to be rebuilt too many times; fix to make sure function substitution doesn't leave the -v option unset

This commit is contained in:
Chet Ramey
2026-05-20 10:18:32 -04:00
parent 669b32f676
commit 2d4ba0c618
15 changed files with 503 additions and 36 deletions
+4
View File
@@ -1581,6 +1581,10 @@ array_value_internal (const char *s, int quoted, int flags, array_eltstate_t *es
retval = quote_nosplit (temp);
free (temp);
}
else if (quoted == 0 && (flags & AV_ASSIGNRHS) == 0 &&
ifs_is_set && ifs_is_null == 0 &&
spctabnl (ifs_firstc[0]) == 0)
retval = string_list_dollar_atstar (l, quoted, 0);
else /* ${name[@]} or unquoted ${name[*]} */
retval = string_list_dollar_at (l, quoted, (flags & AV_ASSIGNRHS) ? PF_ASSIGNRHS : 0);