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

UNC paths are not handled appropriately by path.relative #10528

Closed
amanda-mitchell opened this issue Dec 29, 2016 · 2 comments
Closed

UNC paths are not handled appropriately by path.relative #10528

amanda-mitchell opened this issue Dec 29, 2016 · 2 comments
Labels
path Issues and PRs related to the path subsystem. windows Issues and PRs related to the Windows platform.

Comments

@amanda-mitchell
Copy link

  • Version: 6.3.1
  • Platform: 64 bit Windows 10
  • Subsystem: path.js

When calling path.relative, if the to parameter refers to a UNC (network) path, the result is incorrect.

Steps to Reproduce

Run the following program:

var path = require('path');

console.log(path.relative('c:\\some\\directory', '\\\\localhost\\c$\\another\\directory'));

Expected Result

The console output should be \\localhost\c$\another\directory because no relative path exists between the two paths.

Actual Result

The console output is localhost\c$\another\directory: the leading double backslash is omitted.

Extra Notes

The output is correct for two UNC paths to the same host. The output is incorrect for two UNC paths to different hosts.

@mscdex mscdex added path Issues and PRs related to the path subsystem. windows Issues and PRs related to the Windows platform. labels Dec 29, 2016
@gibfahn
Copy link
Member

gibfahn commented Dec 30, 2016

cc/ @nodejs/platform-windows

@joaocgreis
Copy link
Member

This was fixed in v6.8.0 (duplicate of #8444, fixed in PR #8523).

I'll close the issue, but we can reopen if there's something else to discuss.

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

4 participants