Skip to content

fix: preserve UNC paths in pwd -P#88

Open
a-rookie-of-C-language wants to merge 1 commit into
microsoft:mainfrom
a-rookie-of-C-language:fix/windows-pwd-unc
Open

fix: preserve UNC paths in pwd -P#88
a-rookie-of-C-language wants to merge 1 commit into
microsoft:mainfrom
a-rookie-of-C-language:fix/windows-pwd-unc

Conversation

@a-rookie-of-C-language

@a-rookie-of-C-language a-rookie-of-C-language commented Jun 5, 2026

Copy link
Copy Markdown

close #85 ,#83

Summary

  • Fix pwd -P on Windows when canonicalize() returns a verbatim UNC path.
  • Fix readlink -f on Windows when canonicalization returns a verbatim UNC path.
  • Convert \\?\UNC\server\share\... back to \\server\share\... instead of incorrectly printing UNC\server\share\....
  • Preserve the existing handling for regular verbatim paths like \\?\C:\....

Validation

  • cargo check --manifest-path deps\coreutils\Cargo.toml -p uu_pwd -p uu_readlink
  • cargo run --manifest-path deps\coreutils\Cargo.toml -p uu_pwd -- -P
  • cargo run --manifest-path deps\coreutils\Cargo.toml -p uu_readlink -- -f .

@a-rookie-of-C-language a-rookie-of-C-language force-pushed the fix/windows-pwd-unc branch 3 times, most recently from a3bcce8 to 13c3596 Compare June 5, 2026 14:56
@lhecker lhecker added the C-bug It shouldn't be doing this. label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug It shouldn't be doing this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pwd.exe -P prints invalid UNC path

2 participants