来源:huck 443 条 divergence issue 全量审计(issues-audit)we-diverge 增量,B 组 BC3(B11+B12 合并)+ D 组第 1 项(合并开单);huck 侧 issue #63/#738 互证。 审计基准:GNU bash 5.3.0(WSL stdin 法 oracle)× rubash origin/master 764b9dde debug 构建。 ## 格 1:declare -p 对 C1 控制码点再编码(huck#63) ```sh x=$'\x81'; declare -p x ``` | | GNU bash 5.3.0 | rubash 764b9dde | |---|---|---| | 输出 | `declare -p x` 内 `$'\201'`(原始字节八进制转义) | `$'\302\201'`(把 U+0081 码点再 UTF-8 编码成两字节) | ## 格 2:printf 内建 format 转义再编码(huck#738 / D1) ```sh printf 'a\xe9b' | od -An -tx1 ``` | | GNU bash 5.3.0 | rubash 764b9dde | |---|---|---| | 字节 | `61 e9 62` | `61 c3 a9 62`(e9 被当码点再编码) | **内部不一致**:同一 shell 的 `$'\xe9'` 产出原始字节 `e9`(LEDGER huck#52 复验 rubash 正确),printf format 转义路径却产 `c3 a9`。 ## 依据 - bash 的 `$'\xHH'` 与 printf 的 `\xHH` 都是**字节**转义,输出原始字节;bytes ≥ 0x80 不经码点编码(libsh/ansicolor 与 printf builtin 均字节透明)。 - 错误字节直接落盘/进管道:写二进制协议(如转义序列、校验和)的脚本会拿到悄悄错位的字节流。 - cmdsub 非字节透明大族(huck#738 主条目)中,printf 转义路径与平台无关、可独立修复;env/argv 透传格在 Windows 平台另有约束。 ## 跨实现互证(huck) - [huck#63 "`ansi_c_quote` passes C1 controls (U+0080–U+009F) through literally..."](https://github.com/jdstanhope/huck/issues/63)(open) - [huck#738 "huck is not byte-transparent..."](https://github.com/jdstanhope/huck/issues/738)(open)。 ## 优先级建议 **P2**(输出字节错误——静默产出错误数据字节;建议按"printf/`$''` 转义一律原始字节"一个根因修两格)。
Activity
fix: Wave2c P2 batch - RANDOM reseed on declare -i, heredoc-max fatal…