Skip to content

path: fix win32 relative for driveless root paths#63907

Open
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:fix-path
Open

path: fix win32 relative for driveless root paths#63907
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:fix-path

Conversation

@watilde

@watilde watilde commented Jun 14, 2026

Copy link
Copy Markdown
Member

Driveless rooted paths (e.g. \\aa\\bb) trim their leading separator, breaking the drive/UNC assumptions: relative('\\aa\\bb', '\\a') returned ..\\..a instead of ..\\..\\a. Guard the device-root shortcuts to drive-form paths, insert the missing separator, and treat two driveless rooted paths as sharing the root.

Driveless rooted paths (e.g. `\\aa\\bb`) trim their leading separator,
breaking the drive/UNC assumptions: `relative('\\aa\\bb', '\\a')`
returned `..\\..a` instead of `..\\..\\a`. Guard the device-root
shortcuts to drive-form paths, insert the missing separator, and treat
two driveless rooted paths as sharing the root.

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/path

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. labels Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants