Skip to content

[bug] 混合引号词中引号段在 comsub 前时 CTLESC \x11 载波仍泄漏: echo pre"a*"$(echo hi)post 打出 \x11 #187

Closed

Description

@caomengxuan666

现象

#179 修复了整词双引号形式(echo "a*$(echo hi)*b"),但混合词——未引号开头 + 引号段在 comsub 之前——仍泄漏载波:

echo pre"a*"$(echo hi)post
  • GNU 5.3.0: prea*hipost
  • rubash 49b7d8bf: prea\x11*hipost

根因(49b7d8bf 修复时已定位)

expand_simple_substitution_fragments(src/executor/command_prepare.rs)的字面量片段经 remove_shell_quotes(lexer/quotes.rs remove_double_quoted_into 对双引号内裸 *?[ 加 CTLESC 标注)后进入 ExpandedFragment 字节拼接,bytes_to_shell_text 把每个 C0 字节重标记为 DATA(E000 对),标注被冻结为字面 0x11。49b7d8bf 仅对首字符即引号的 raw 词去标注(那种词 suppress_glob 全局成立);混合词的引号段标注仍需供 pathname expansion 抑制使用,故保留——泄漏与 glob 抑制的张力需要 ExpandedFragment 的 quoted 标志真正参与拼接/glob 模型才能两全(GNU subst.c:12273+ 每个 fragment 携带 quoted 标志,glob 时按 fragment 保护、物化时统一 dequote_string)。

复现与产物

  • probe: target/issue-suites/results/n1-exec-2026-09-26/mixedspan-probe.sh(LF 双侧脚本文件)
  • rubash: mixedspan-rub.od(021 可见);GNU: mixedspan-gnu.od

版本: rubash 49b7d8bf (wt/n1-exec), 对照 WSL GNU Bash 5.3.0(1)-release。

Activity

  1. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已在 51df49a 修复并关闭(commit 48089806,四单合一)。GNU 锚点与矩阵见 issue 评论区独立说明。

  2. added
    bug
    area:carrier
    family:M1
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:carrierbugfamily:M1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions