Skip to content

fix(path): operand-boundary residuals — less, unix2dos family, dos2unix write side, cygpath -u, which (#1385) - #1421

Merged
caomengxuan666 merged 1 commit into
mainfrom
fix/iss-operand-boundary
Oct 27, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
fix/iss-operand-boundary

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Fixes #1385 (except the cpio face, which the issue itself scopes to a separate issue — archive-member names are archive content, not argv operands).

Six residual faces from the #1364 operand-boundary audit now route through the shared fold:

  • less/pager: file operands open through normalize_api_operand instead of a raw std::ifstream.
  • unix2dos / u2d: raw stream opens replaced with the folded operand.
  • dos2unix: the write side now writes the folded spelling (the read side was already on the boundary).
  • cygpath -u: payload-native paths print their shell-namespace mount name (<payload>\sub → /sub) via the new native_path::shell_tree_display accessor instead of folding the payload drive to /z/. The accessor declines the /home alias for this caller — cygpath mirrors on-disk layout, so C:\Users\... keeps its drive spelling (three pre-existing cygpath pins caught this during verification).
  • which: the operand's directory part folds through the boundary; the parent's POSIX absoluteness is judged on its leading separator (/ra-tool's parent is / even though fs::path calls it drive-relative on Windows).

Every face carries a regression: bare / lands in the payload root, /c-spellings unchanged, relative operands untouched. Full suite on the branch: 3350 passed, 0 failed (baseline exclusions only). i18n delta: none.

… shared fold (#1385)

The #1364 audit's remaining faces, minus cpio (its archive-member names
are a different operand class and get their own issue):

- less/pager: file operands open through normalize_api_operand instead
  of a raw ifstream.
- unix2dos/u2d/dos2unix: the read side folds; dos2unix's write side now
  writes the folded spelling instead of re-opening the raw operand.
- cygpath -u: prints the shell-namespace mount name for payload paths
  via the new native_path::shell_tree_display accessor (with the /home
  alias declined — cygpath mirrors on-disk layout), instead of folding
  the payload drive to /z/.
- which: the operand's directory part folds through the boundary, with
  the POSIX-absolute parent judged on its leading separator ("/ra-tool"'s
  parent is "/" even though fs::path calls it drive-relative).

Every face carries a regression: bare "/" lands in the payload root,
/c-spellings are unchanged, relative operands untouched.
@caomengxuan666
caomengxuan666 merged commit bb3a220 into main Oct 27, 2026
3 of 4 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/iss-operand-boundary branch October 27, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug][path] Operand-boundary residuals from the #1364 audit: cpio / less / unix2dos family / dos2unix write side / cygpath -u display / which edge

1 participant