You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dirname/basename fast path: leading // and empty operand mishandled (string edge cases) #709
The inline dirname/basename fast paths (src/executor/printf_path_builtins.rs)
implement pure POSIX string semantics by hand and diverge on two edge cases:
a leading // must be preserved, and an empty operand must yield . /
the empty string. These are independent of the /a/b -> A: translation tracked
in niubash#346 (fixed by rubash#649 + niubash#371) and remain in dirname_value/basename_value on origin/master.
Cause: trim_trailing_slashes maps an all-slash value to the empty string and dirname_value/basename_value then return /; an empty operand hits the same
fallback.
Not the same as
niubash#346 item (c): dirname /a/b -> A: — operand pre-translation, fixed by
rubash#649; reproduces only on rubash e785c3c8 and is not re-filed here.
basename // returns / in the fast path and WinuxCmd (GNU //): a
shared divergence, recorded in the audit but not part of this bug.
Activity
docs(audit): link filed issues from the fast-path catalogue and harness
docs(audit): fast-path differential catalogue and harness (niubash#383)
docs(audit): fast-path differential catalogue and harness (niubash#38…
fix: fast-path differential divergences #707/#708/#709 (tr carriers, …
caomengxuan666 commentedon Oct 17, 2026
已在
d4f0b67(PR #718)修掉,只是 issue 没跟着关。当前 masterd248d9f复验:dirname //////dirname //a////dirname ''..basename ''basename ////(共享差异,本就不在范围)注:沙箱里的 GNU coreutils
dirname对//输出/,POSIX 把//留给实现定义,所以这里按 issue 里的 Git Bash oracle 判。