Repository navigation
fix(executor): keep quoting state on quoted compound elements (#377) - #730
Merged
Merged
Conversation
Whole-quote-wrapped NoMatch elements were pushed marker + dequoted
text; the consumer globbed the dequoted text, dropping quoting state
(declare -a d3=("$x") with x='*' stored the matches). Serialize
CTLESC protection inside the quotes instead; dequote the subscript
left side for index parsing (no-op when absent).
issue377 file 10/12 -> 11/12 (rest is pre-existing empty-member);
glob 34/34, casearm 30/30, lib 596/596.
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): keep quoting state on quoted compound elements (#377)
What
x='*'; declare -a d3=("$x")stored the glob matches instead ofliteral
*(same for("*")literals). Even a quoted literal globs;unquoted
(*)correctly globs. Quoting was dropped, not honored.Root cause
The NoMatch arm of the compound-element expander pushed
marker+dequoted text for whole-quoted tokens; the storage consumer
then globbed the DEQUOTED text. GNU globs the STILL-QUOTED word
(
glob_expand_word_list,subst.c:12604, runs on CTLESC-laden text;dequote comes after) — quoted content never matches. (An earlier
wrong theory blaming double-CTLESC-marking was disproven by unit
test; the token stream probes pinned the real chain.)
Fix
protection INSIDE the quotes (like the existing CTLESC serializer);
unwrapped tokens keep the old form (their quotes, if any, are DATA).
=arm: dequote-CTLESC the subscript left side beforearray_assignment_index(no-op when absent), so protected[2]still binds.
Verification
$x,unquoted glob,
[2]=v/a=b/a bedges).issue377file 10/12 → 11/12 (rest is the pre-existing,base-identical dot-IFS empty-member divergence).
glob_diff.sh34/34,casearm_diff.sh30/30, lib 596/596,declare executor subset 61/61.
except the fixed file itself (11/1 vs 10/2). Zero NEW tests; the
single DISAPPEARED is the fixed test. (The tool's cli_tests/
issue297_300 NEW-target rows are the known parse artifact.)
No regression.
6295367, only rubash[patch]switched): failure sets byte-identical (8=8).