You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Single-quoted ${@} in a compound array assignment expands instead of staying literal: A=('${@}') stores the parameter values (GNU stores one literal element) #303
Found by wt10/fieldsplit while fixing #298 (adjacent pre-existing defect, verified identical before/after that fix): A=('${@}') — with single quotes the element must stay the LITERAL four characters ${@} (GNU stores one such element), but we expand it. Unquoted and double-quoted forms are correct. Quote-promotion (E307 carrier) interacting with the compound walker; same function family as #298's assignment_expansion.rs paths. GNU anchor: arrayfunc.c:585 parse_string_to_word_list keeps W_QUOTED, and single-quoted spans carry no expansion.
Fixed by wt11/almix (f9d9be44, master): fieldsplit's '$@' guard checked the ORIGINAL quote delimiters, but expand_assignment_value_hoisting had already hoisted them to E307 sentinels — the guard could never hit; deeper, hoist_data_single_quotes' ${...}/$'...' skip branches applied INSIDE the span too, letting the live ${@} through to the walker. Both skip branches now carry a !in_span gate (fixing the wrong invariant, not adding a guard); in-span $ takes the existing SQ_DOLLAR_DATA channel. GNU anchors: arrayfunc.c:557-610 -> parse_string_to_word_list (W_QUOTED word) -> expand_words_no_vars never sees live ${...} inside a quoted span.
Verification: full class byte-identical to WSL GNU Bash 5.3.0 — '${@}' (one literal element), 'a${@}b', 'a${v}b', '${v:-y}', '${*}', '${#}', 'a$1b', 'a\b'; #298 neighborhood guarded ("${@}" fan-out and bare $@ splitting unaffected); 503/27/12/10 gates green.
Activity
fix(#301,#303): quote-span backslashes and `${@}` are storage data, n…
caomengxuan666 commentedon Sep 28, 2026
Fixed by wt11/almix (f9d9be44, master): fieldsplit's '$@' guard checked the ORIGINAL quote delimiters, but expand_assignment_value_hoisting had already hoisted them to E307 sentinels — the guard could never hit; deeper, hoist_data_single_quotes'${...}/$ '...' skip branches applied INSIDE the span too, letting the live ${@} through to the walker. Both skip branches now carry a !in_span gate (fixing the wrong invariant, not adding a guard); in-span $ takes the existing SQ_DOLLAR_DATA channel. GNU anchors: arrayfunc.c:557-610 -> parse_string_to_word_list (W_QUOTED word) -> expand_words_no_vars never sees live ${...} inside a quoted span.
Verification: full class byte-identical to WSL GNU Bash 5.3.0 — '${@}' (one literal element), 'a${@}b', 'a${v}b', '${v:-y}', '${*}', '${#}', 'a$1b', 'a\b'; #298 neighborhood guarded ("${@}" fan-out and bare $@ splitting unaffected); 503/27/12/10 gates green.