Repository navigation
fix(executor): admit [*]/* operator segments to the quoted-aware list path - #3632
Merged
Merged
Conversation
…list path (Refs #3581) A quoted one-"" `[*]`/` *` pattern-removal segment inside a mixed word (`X"${a[*]#...}"Y`) stayed silent where GNU diagnoses `bad substitution`: the `AtModified` segment classifier admitted only `@`/`name[@]`, so the star forms fell through to the scalar braced path, whose removal gate hardcodes `empty_is_silent = true` and never sees the quoted flag. GNU applies the operator per element for `[*]`/` *` exactly as for `[@]`/`@` and joins afterwards (subst.c:10119-10128 chk_atstar covers both; the #1456 "the String path already does the join" rationale only holds for the VALUE, not the quote-sensitive removal gate at subst.c:10320-10327, which reads the QUOTED_NULL-marked joined word, 10133-10140). The fix admits `*`/`name[*]` to `at_modified_segment_body` and routes leading-`*` inners to `positional_modified_word_values` in `at_modified_segment_values`; all other paths are untouched. Regression pin tests/issue3581_star_join_quoted_null.rs: 27/27 on head (fail-first on base: 23/27, the 4 affixed removal cells red). Refs #3581
Member
Author
|
【WIN-AGENT-AUDIT】 机制核查:
腿:
F 点:无 |
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3581
A quoted one-
""[*]/*pattern-removal segment inside a mixed word(
X"${a[*]#...}"Y) stayed silent where GNU diagnosesbad substitution:the
AtModifiedsegment classifier admitted only@/name[@], so thestar forms fell through to the scalar braced path, whose removal gate
hardcodes
empty_is_silent = trueand never sees the quoted flag. GNUapplies the operator per element for
[*]/*exactly as for[@]/@and joins afterwards (subst.c:10119-10128 chk_atstar covers both).
Fix (
src/executor/command_substitution_values.rsonly):at_modified_segment_bodyadmits*andname[*]; the [bug] "${arr[@] op}" adjacent to literal text collapses all elements into one space-joined word #1456 docrationale ("the String path already does the join") is corrected —
it holds for the value, not the quote-sensitive removal gate
(subst.c:10320-10327 reads the QUOTED_NULL-marked joined word,
10133-10140).
at_modified_segment_valuesroutes leading-*inners topositional_modified_word_values, like@.Legs (head
debcf8a5on tip55fd6a02):tests/issue3581_star_join_quoted_null.rs: 27/27 onhead; fail-first on tip
27e1d0d2: 23/27 (the 4 affixed removal cellsred: A2/A4
#and%).RUSTFLAGS="-D warnings": rc=0, 0 warnings (recompile proven).extra 16-case matrix (IFS variants,
//,,,,^^,@Q) 16/16 OK.Note: master has since moved to
ca89c83a(#3577 merged); its files(
array_assignment_exec.rs,dynamic_arrays.rs,job_builtins.rs,state_views.rs,unset_arrays.rs) do not intersect this change, sothe merge round's update-branch should apply cleanly.