Repository navigation
fix(read): drive the coproc serve through the FdRecordScan unit replay (Refs #3305) - #3559
Merged
Merged
Conversation
…y (Refs #3305) read_coproc_stdout compared the delimiter on every byte and counted the -n/-N budget per byte. GNU builtins/read.def:834 compares the stream byte against the first byte of the -d word only at a read_mbchar unit start, and read.def:884-886 counts the budget per completed unit (post-escape). The fd-table serves already replay that loop through FdRecordScan; the coproc serve now drives the same scanner, dropping the delimiter like they do. ReadEscapeTracker (its last user) is gone. Also rustfmt the d11 stem (master drift from #3511) so the fmt hook passes. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
caomengxuan666
marked this pull request as ready for review
November 14, 2026 05:16
caomengxuan666
marked this pull request as draft
November 14, 2026 05:45
caomengxuan666
marked this pull request as ready for review
November 16, 2026 11:47
Member
Author
|
【WIN-AGENT-AUDIT】s10 lane 第 2 轮 — 建议:PASS(按 S 波授权已 squash 合入) head: 27a409f base(merge-base): 8b48c16 文件: 3 个 +168/-91 机制核查:
腿(逐项给数字与名字):
F 点:无 未跑/VOID 的腿:
|
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.
修了什么
read的 coproc serve(read_io.rsread_coproc_stdout)原先逐字节工作:每个字节都做分隔符比较(delimiter_byte_matches),-n/-N按字节计数。改为驱动 fd-table 各 serve 已在用的FdRecordScan(GNU read 循环的增量重放):-d词的首字节比较;非法序列被分隔符字节打断时按 delim_ind 回推规则终止;-n/-N预算按完成的单位计(post-escape:转义对算 1、反斜杠续行算 0),不在字符中途截断;sequence_ending_at);四格(C.UTF-8,存活子进程形):
-d é读a é b é[61]/[a962]rc=0[61c3]/[a962c3]-n 1读E0 80 80 A[e08080]/[41][e0]/[80]-d $'\251'读 é(EOF)[c3a9]rc=1[c3a9]rc=0-n 1读\+é[c3a9][c3]删了什么
consumed_chars计数、EOF 时的转义重放。ReadEscapeTracker(coproc 循环是它最后的使用者)。GNU 依据
builtins/read.def:385取-d词首字节;read.def:834在 read_mbchar 消费前比较该字节(只在单位起点)。read.def:884-886每次 read_mbchar 后nr++(预算按单位)。FdRecordScan文档(fd_table.rs,read: C.UTF-8 file loop fd_table mb serve diverges on multibyte delimiter remainder #3291/read -n: illegal UTF-8 sequence measured as 1-byte units (GNU/glibc mbrtowc consumes the whole sequence) #3294 波已按 GNU 对齐)。验证
tests/issue3305_read_coproc_unit_scan.rs(7 例:C1–C4 四格 + 字节 locale 序列形、UTF-8-N/-n/行/空记录、无 -r 自定义分隔符转义与续行三组对照),期望全部取自 WSL GNU 5.3.20 脚本文件实测。未修树 2 passed / 5 failed(两组对照本就过),修后 7/7。-t超时 rc=142 格)rubash 与 GNU 字节一致。--lib read_8/8。issue277declare_p_renders_esc、issue714read_n_multiple_carriers_in_payload在未修树上同样失败,与本改动无关。tests/d11_pipeline_squote_carrier_regressions.rs仅 rustfmt(master 上 fix(executor): restore DATA_SQUOTE carrier on pipeline child-argv boundaries #3511 遗留的格式漂移,fmt hook 需要)。Owed
read_coproc_stdout的escape_aware参数保留但不再使用(与 fd-table serve 相同,转义由raw决定);未清理调用方签名。Fixes #3305