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
[paths] Trailing dot/space operands silently hit the wrong file in normalize/raw path tiers (sed reads 'name' for 'name.'; sed -i overwrites the wrong file) #1332
Operands whose final component ends in a dot or space are silently resolved to the wrong file by commands whose path layer only normalizes (or passes the path raw): the Win32 DOS path rules strip the trailing dot/space, so the command reads — or worse, overwrites — the sibling file without the suffix. Commands on the extended-path layer are immune; the layers disagree, so behavior differs per command for the same operand.
Evidence (harness vs GNU, identical fixtures, post-state compared; two runs)
Fixture contains BOTH files: name (content B) and name. (content A).
Read: sed -n p 'name.'
GNU: prints content A.
WinuxCmd: prints content B (read name), rc0, no diagnostic.
Write via sed -i: sed -i s/B/C/ 'name.' (fixture: name=lineB, name.=lineC-pending...)
precisely: files name (lineB) and name. (lineC); run sed -i 's/line/EDIT/' 'name.':
GNU post-state: name. edited, name untouched.
WinuxCmd post-state: name edited, name. untouched — the -i temp+rename chain lands on the stripped name. Silent data corruption of the wrong file.
Control: grep and cat probes of the same read operand matched GNU in this harness — the fidelity differs per command/path layer (sed's normalize path loses the suffix; the extended-path commands keep it). cat 'name ' (trailing space) family is the same shape.
Source
src/utils/native_path.cppm: commands route operands through three tiers — extended (make_api_path_operand/to_extended_path[_preserving]: suffix preserved), normalize-only (suffix lost to DOS rules on open), raw CreateFile/std::filesystem (same loss). sed uses the normalize tier including for its -i temp/rename chain. The winmine audit counted 51 normalize-tier + 14 raw-tier commands with file operands vs 43 extended-tier; any normalize/raw command is exposed (sed proven for read+write).
Regression seed
Both sed cases with post-state assertions; extend the same fixture pair (name + name., name + name␣) across the normalize/raw-tier commands when fixing.
Found by the full-audit (Windows minefield sweep). Related to the fixed long-path work (#1288/#1293) but a different mechanism (suffix fidelity, not length).
Activity
test(cat): close the issue_1288 test body before the #1333 tests
fix(cpio): route archive and member paths through the operand boundar…
fix(cpio): route archive and member paths through the operand boundar…
fix(cpio): route archive and member paths through the operand boundar…
test(grep,sed): close the test bodies left open at the #1332 append j…
fix(cpio): route archive and member paths through the operand boundar…
fix(cpio): route archive and member paths through the operand boundar…
Merge pull request #1415 from unixwin/fix/winx3-paths
feat(sed): wire rust2 sed into the product path (#1488) (#1690)
feat(a1): replay preserve-root closure + chmod/chgrp/chown tr! on main (