Repository navigation
fix(executor): non-CBSDQUOTE backslash inside dq alternate span is data (Refs #3117) - #3691
Merged
Merged
Conversation
…ta (Refs #3117) Inside a double-quoted span of an unquoted alternate word, a backslash is special only before the CBSDQUOTE set ($ ` " \ newline — syntax.h:58, subst.c:11671-11674 in expand_word_internal); before any other character both bytes are literal data. The walk lost the span boundary, so the trailing unquoted-unescape pass stripped the backslash anyway (${x:-"a\qb"} -> aqb instead of a\qb). The protect_ifs&&protect_data arm now consumes the next character on a non-CBSDQUOTE pair and emits ASSIGN_EXPANSION_BACKSLASH (plus IFS_GLUE ahead of whitespace), carrying the literal backslash through the later pass like the live-escape carriers from #3116. GNU: subst.c:11229 expand_word_internal backslash arm (11614-11678, CBSDQUOTE-only special set in dq context), syntax.h:58. tests/issue3117_alternate_dq_span_backslash.rs: 24/24 (was 11/24). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Nov 15, 2026
Closed
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.
Summary
tests/issue3117_alternate_dq_span_backslash.rswas 11/24 after #3684: inside a double-quoted span of an unquoted alternate word, a backslash is special only before CBSDQUOTE ($\backtick quote newline —syntax.h:58,subst.c:11671-11674); before any other character both bytes are literal data. The walk dropped the span boundary so the trailing unescape removed the backslash (${x:-"a\qb"}→aqb).The
protect_ifs && protect_dataarm now carries non-CBSDQUOTE pairs viaASSIGN_EXPANSION_BACKSLASH(+IFS_GLUEbefore whitespace), same carrier family as the live escapes from #3116.Legs
cargo test --test issue3117_alternate_dq_span_backslash: 24/24 on top of merged fix(executor): alternate rhs $ escape resolves at walk time (Refs #3116) #3684.subst.c:11229 expand_word_internalbackslash arm,syntax.h:58CBSDQUOTE.fix/3116semantics; stacked on master post-merge (77ded99).Generated with Devin