Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path.relative method returns wrong path when UNC path is provided #8444

Closed
amatas opened this issue Sep 8, 2016 · 0 comments
Closed

path.relative method returns wrong path when UNC path is provided #8444

amatas opened this issue Sep 8, 2016 · 0 comments
Labels
path Issues and PRs related to the path subsystem. windows Issues and PRs related to the Windows platform.

Comments

@amatas
Copy link

amatas commented Sep 8, 2016

It seems that versions prior v6 are not affected.

  • Version: v6
  • Platform: windows
  • Subsystem: path

Tests:

  • Windows 10 with node 4.5.0:
  c:\>node -e "console.log(require('path').relative('.','\\\\VBOXSRV\\vagrant'))"

returns: \\VBOXSRV\vagrant\

  • Windows 10 with node 6.5.0:
  c:\>node -e "console.log(require('path').relative('.','\\\\VBOXSRV\\vagrant'))"

returns: VBOXSRV\vagrant\(the leading backslashes are missing)
expected: \\VBOXSRV\vagrant\

Related issue: nodejs/nan#601

@mscdex mscdex added windows Issues and PRs related to the Windows platform. path Issues and PRs related to the path subsystem. labels Sep 8, 2016
jasongin added a commit to jasongin/nodejs that referenced this issue Sep 13, 2016
When the result of a path.relative() is an absolute UNC path, it should
include the leading backslashes.

Fixes: nodejs#8444
@jasnell jasnell closed this as completed Sep 20, 2016
jasnell pushed a commit that referenced this issue Sep 20, 2016
When the result of a path.relative() is an absolute UNC path, it should
include the leading backslashes.

Fixes: #8444
PR-URL: #8523
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Fishrock123 pushed a commit that referenced this issue Oct 11, 2016
When the result of a path.relative() is an absolute UNC path, it should
include the leading backslashes.

Fixes: #8444
PR-URL: #8523
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
path Issues and PRs related to the path subsystem. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

2 participants