- 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.
path.jsWhen calling
path.relative, if thetoparameter refers to a UNC (network) path, the result is incorrect.Steps to Reproduce
Run the following program:
Expected Result
The console output should be
\\localhost\c$\another\directorybecause 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.