Repository navigation
fix(executor): GNU UNQUOTED null-word discard for inner quoted nulls - #3748
Conversation
…ulls (Refs #3605) GNU subst.c:12026-12048 (expand_word_internal end-of-word): a word whose expansion is all-null keeps one field only under had_quoted_null or PARTIALLY_QUOTED state; an UNQUOTED word (or quoted_dollar_at) is discarded. Quoting bytes inside the word's own ${...}/$(...) constructs are inner syntax, so QUOTED_NULL_MARKERs produced by ${v=''} never anchor the outer field. - strip bare QUOTED_NULL_MARKERs from the expanded word before the empty/split verdicts when the word itself is unquoted (${v=''}, ${v= ''}, ${v=$*} with an empty positional now drop; [[ operands and partially/fully quoted outer words are unchanged) - widen the empty-expanded discard past removes_unquoted_null_word's TokenKind::Variable admission for the same UNQUOTED class - splits_unquoted_expanded_word: an empty expansion never splits (the remove/keep decision already ran upstream) - quoted "$@" segments: scan backslash per double-quote rules and cook literal pieces through remove_double_quoted_into_cursor (pub(crate)), so "123 $@\ 456"-family spans segment correctly Verified: probe matrix (at3/at3b/at3c/at5b-h/at10-e, st10/st10b) and the dollar-*.sub gate slice are byte-identical to GNU bash 5.3.20 except the pre-existing ${op+ RHS} inner-space family (dollar-at-star9/dollar-star7/ dollar-star9/dollar-at7, separate root cause). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
队长复核:FAIL(E7 marker-lint,1 处违规,须返工)。 Linux Rust tests job 未跑到 lib 测试——死在
本 PR 在 command_prepare.rs:3105 直接用 其余腿已按名,无 PR 专属红:goldens job lib 腿 1351/1、macOS lib 1245/1,唯一红格皆 issue2875 基线;canary 只红已知 ledger 漂移(MISSING Session::cwd,repl.rs:2004)。正文缺「本 PR 删除了什么」节,合入时队长补。 |
…ware helper E7 marker-lint flagged the bare .contains(QUOTED_NULL_MARKER) at the unquoted-null-word boundary as an unreviewed blind-consumer site. The check itself only routed into restore_bare_sentinels (already pair-aware), so the fix is the offered shape: a Cow-returning single-rule helper in markers.rs that keeps the no-marker borrow and confines the needle operation to the registry module. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
E7 违规已修(新头 |
|
队长复核:FAIL 撤销,返工已核,入 Wave 2。 新头 新头 CI 已按名(run 43773489867 / canary 43773489871):三条 lib 腿失败测试按名皆仅 Wave 2 仍欠:钉 fail-first + 全绿、邻居、lib 双边、 |
|
【WIN-AGENT-AUDIT】PR #3748 第2轮 — 建议:PASS 机制核查:
腿(逐项给数字与名字):
F 点:无 未跑/VOID 的腿:无 合并处置:head 与审计时点一致(f477ff72)、MERGEABLE,已 squash 合入;#3605 为伞目录 issue,按台账铁律不关单。 |
Summary
run-dollars
$*/$@empty-word semantics: an UNQUOTED word whose expansion is all-null must be discarded even when the null was produced by quoted constructs INSIDE the word's own${...}/$(...)(GNU subst.c:12026-12048 — the innerhad_quoted_nulldoes not set the outer word's quoting state).Fixes
recho ${v=''},recho ${v= ''},recho ${v=$*}(empty positional) emitting a spurious<>argument, plus"$@"segment scanning of backslash/literal pieces ("123 $@\ 456"family).command_prepare.rs: strip bare QUOTED_NULL_MARKERs before the empty/split verdicts for unquoted outer words; widen the empty-expanded discard past the Variable-kind admission ([[guard preserved)command_words.rs: an empty expansion never field-splitscommand_substitution_values.rs: backslash scanned per double-quote escape rules; literal pieces cooked viaremove_double_quoted_into_cursor(nowpub(crate))Verified byte-identical to GNU bash 5.3.20 across the probe matrix and the dollar-*.sub slice; residual diffs are the pre-existing
${op+ RHS}inner-space family (separate root cause).Refs #3605