Repository navigation
fix(executor): dequote for-list bindings so loop vars glob (#675) - #683
Merged
Merged
Conversation
for p in "f*" bound f+CTLESC+* (len 3, glob-dead) instead of plain f* (GNU dequote_string, subst.c:4807, dequotes every bound word once splitting/globbing decided). finalize_for_list_value at all four for-list bind sites in expand_for_brace_word_values. #662 classifier untouched. casearm 29/30 -> 30/30, ifcase 55/55. 3 new tests.
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.
fix(executor): dequote for-list bindings (loop-var glob loss) (#675)
What
for p in "f*"; do case foobar in $p)missed in rubash (MISS:f*)but hits in GNU (
HIT:f*). Deeper than the case arm:${#p}was 3vs GNU 2, and unquoted
$pnever globbed anywhere — the loop variablebound
f+CTLESC+*instead of plainf*. Only the double-quotedfor-list path skipped dequote (single-quoted, assignment, and argv
paths all dequote).
Fix (wrong invariant, no new guard)
finalize_for_list_value(storage-side half of GNUdequote_string,subst.c:4807viadequote_ctlesc_pairs,markers.rs:752) appliedat all four for-list bind sites in
expand_for_brace_word_values.GNU dequotes every bound word once splitting/globbing have decided,
quoted or not; the #662 fast-path classifier is untouched (it already
routes
$...to the slow path).Verification
HIT:f*,<foobar>,len=2).casearm_diff.sh29/30 → 30/30;ifcase_diff.sh55/55.issue675_casearm_loopvar_regressions(3 tests).cargo test --lib594/594; for-list glob, quoted-element, case,arith-for, quote-roundtrip, extglob suites green.
except the new regression file itself (3/3). Test-level 2 NEW / 1
DISAPPEARED, all three in the known-nondeterministic
part_080coproc family (all pass in isolation on branch). No regression.
6295367, only rubash[patch]switched): failure sets byte-identical (49=49).