Repository navigation
fix(uniq): +NUM after -- is a file operand, not skip-chars (#1878) - #2009
Merged
Merged
Conversation
Member
Author
队长复核:可合入(2026-12-01)x64 default 腿已绿(31m30s)。其 CTest 日志核查:100% tests passed,0 failures(job 141913055647,日志 1.5MB)。其余腿全部绿:baseline、compare、oracle、rust-tests(含新增的 uniq 单测)、i18n-drift、arm64 各腿。 唯一红项是 |
This was referenced Nov 30, 2026
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.
队长中继:uniq 的 #1878 修复(Rust 面)
Refs #1878。接 #1877 合入后,uniq 的产品路径已切换到本 Rust 实现,而其
uniq.rs仍带着 #1878 的原 bug:+NUM转换作用于整个raw_operands池(含--之后的操作数)。本 PR 是队长在 #1879 车道时备好的中继补丁(原 patch 2/2),已按当前 main 的行号漂移手工适配,改动与原补丁逐项一致:--之后的操作数改入独立的after_dashdash池,逐字作为文件名;+NUM旧式 skip-chars 转换只作用于--之前的池(uniq.c:507-545:getopt 的 case 1 只回 pre---操作数,--之后经 optc == -1 尾段到达、是文件本体);after_dashdash在转换后以普通文件身份并入files_only(含双操作数上限与 glob 展开的既有语义不变)。-- +3 u.txt报错+3: No such file or directory、-- +3 a b报extra operand 'b'、+3/+3 --的旧式语义不变;以及真有名为+3的文件时uniq -- +3能读它(与云端 pristine coreutils 9.4 oracle 的已验行为一致,见 fix(uniq): treat +NUM after -- as a file name (Fixes #1878) #2008 复核卷宗)。C++ 面的同一修复在 #2008(作者侧,待补 2 条测试);本 PR 只管已上产品路径的 Rust 面,是 1.2.4 点火前必须落地项(发版预检卷宗
release-preflight-1.5.3-2026-11-30.md§4)。UNVERIFIED-BY-CAPTAIN(队长中继制):本地仅做文本适配与逐项 diff 核对,未在本机编译;以本 PR 的 CI(CTest + rust2 gate)为验证面,队长终裁后合入。