Repository navigation
fix(native_path): preserve literal trailing '.'/' ' components in to_extended_path - #1293
Merged
Merged
Conversation
…extended_path (#1283) GetFullPathNameW strips a trailing dot or space from every component, so an operand naming an on-disk "inner." or "tt " entry absolutized onto a different (usually missing) name and every probe reported ENOENT. When such a component is present, absolutize lexically instead: resolve the root form (UNC share, drive-absolute, drive-relative, cwd-relative), fold "." and "..", and keep every other component verbatim so the \\?\ result reaches the same literal name MSYS opens. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Oct 25, 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.
Fixes #1283
Summary
PR #1285 (merged) fixed the
findhard-crash half: the walk now probes/iterates through\\?\extended paths, so both repros below no longer crash on a fresh master build. Residual: an operand spelling that names a trailing-dot/space entry still resolved to the wrong object becauseto_extended_pathabsolutizes viaGetFullPathNameW, which strips a trailing.orfrom every component (D:\x\inner.→D:\x\inner→ ENOENT).find,ls,stat,catall reported "No such file or directory" for entries that exist — while MSYS resolves them.This PR absolutizes lexically when any component ends in
./(and is not./..): resolves the root form (UNC share,X:\absolute,X:drive-relative via its own cwd,\cwd-rooted, plain relative via cwd), folds./.., and keeps every other component verbatim so the\\?\result reaches the same literal name MSYS opens. All other spellings keep the existingGetFullPathNameWpath.Verified on the fresh build
Before (master @628cdd8):
After:
mkdir D:\x\NULnow refuses cleanly (exit 1), matching the issue's "refuse creation" resolution;mkdir existing/mkdir -v/rm -v/D:namefindings verified already fixed on master.Test plan
find.find_trailing_dot_root_resolves_literal_namecreates a realinner.dir via\\?\and assertsfind inner./+find inner.enumerate itwinuxcmd-tests --run-test find: 120/120 pass; sweep of find/ls/stat/mkdir/rmdir/rm/realpath/cat/touch/cp/mv: 508 tests, only failure was the pre-existing broken test-write helper (fixed in this test)scripts/format.pycleanGenerated with Devin