Conversation
…2.resolve (JS) Move the fix for Windows extended-length path prefix handling from lib/fs.js to the C++ PathResolve function (src/path.cc) and the JS path.resolve function (lib/path.js). The \\?\ prefix is a Win32 API mechanism for bypassing MAX_PATH limits. When path.resolve encounters paths like \\?\C:\foo or \\?\UNC\server\share, it should strip the prefix and resolve the underlying standard path. Device paths like \\?\PHYSICALDRIVE0 are left unchanged. This fix addresses the root cause in the path resolution layer rather than working around it in fs.realpathSync/realpath. Agent-Logs-Url: https://github.com/jazelly/node/sessions/b73cebf2-9b87-42a3-a50e-c5da1b454971 Co-authored-by: jazelly <28685065+jazelly@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jazelly
April 1, 2026 00:07
View session
jazelly
approved these changes
Apr 1, 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.
StripExtendedPathPrefixhelper tosrc/path.ccthat strips\\?\C:\...→C:\...and\\?\UNC\...→\\...(leaving device paths unchanged)PathResolvefor each input pathlib/path.jswin32.resolveto keep JS/C++ in synclib/fs.js(removestripExtendedPathPrefixand all call sites)test/parallel/test-fs-realpath-extended-windows-path.js(replaced by C++ tests)test/cctest/test_path.ccfor extended-length path resolutiontest/parallel/test-path-resolve.js