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
[bug] case pattern from expansion: quote chars in the result are wrongly treated as pattern quoting (glob killed) #2428
A case pattern that arrives via parameter expansion is mis-quoted when the expansion result contains quote characters: rubash reads quote spans in the result as pattern quoting, but GNU treats expansion results as carrying no quoting — glob characters inside them stay live.
Found en route to #2421 (PR #2427). Separate mechanism from #2421, present identically on master 42121884 and on the #2427 branch — not a regression.
var-pattern: MATCH
var-pattern-star: MATCH
var-quote-mid: MATCH
Actual (rubash master)
var-pattern: nomatch
var-pattern-star: nomatch
var-quote-mid: MATCH
Root area
decode_parameter_pattern_quotes in the case-pattern preparation path applies source-level quote semantics to the expansion result. Per GNU, quoting is a read-time property of the pattern word (parse.y read_token_word / CTLESC marking); text produced by expansion has no quoting attached, so */?/[...] in it are live pattern operators and " is an ordinary character. The fix belongs to the pattern-prep mechanism (distinguish source-quoted spans from expansion-result text), not to per-shape special cases.
Fix destination
Pattern family, later wave (post-1.5.0-gate, land-if-clean). PR #2427 does not cover this. Regression seed: the repro above, expectations per GNU.
PR #2451 (merged, master d44dce1). Case patterns decoded from expansion results now use the expansion-result quote mode (quoting is read-time only — parse.y CTLESC; execute_cmd.c:3733-3736), so glob characters arriving from values stay literal. My verification: issue2428 pins 4/4 + the #2421 guard target 6/6 green (scrubbed-fd harness).
Activity
Merge pull request #2451 from unixwin/fix/expansion-2441-2428-2417
caomengxuan666 commentedon Nov 1, 2026
PR #2451 (merged, master d44dce1). Case patterns decoded from expansion results now use the expansion-result quote mode (quoting is read-time only — parse.y CTLESC; execute_cmd.c:3733-3736), so glob characters arriving from values stay literal. My verification: issue2428 pins 4/4 + the #2421 guard target 6/6 green (scrubbed-fd harness).