diff options
author | Jason Ginchereau <jasongin@microsoft.com> | 2016-09-13 22:06:10 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-09-20 19:56:50 +0300 |
commit | c1e47ed8c883afba3c240e89d763a28a57ec1373 (patch) | |
tree | caea3252704eef64cfc4a42597cb0bc075118f00 /lib/path.js | |
parent | 0f7fffb329ff522ba77cb1e98637ee54a498f186 (diff) |
path: fix path.relative UNC path result
When the result of a path.relative() is an absolute UNC path, it should
include the leading backslashes.
Fixes: https://github.com/nodejs/node/issues/8444
PR-URL: https://github.com/nodejs/node/pull/8523
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Diffstat (limited to 'lib/path.js')
-rw-r--r-- | lib/path.js | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/path.js b/lib/path.js index 5637b328c1d..f2fb19edd9e 100644 --- a/lib/path.js +++ b/lib/path.js @@ -619,12 +619,8 @@ const win32 = { // We found a mismatch before the first common path separator was seen, so // return the original `to`. - // TODO: do this just for device roots (and not UNC paths)? if (i !== length && lastCommonSep === -1) { - if (toStart > 0) - return toOrig.slice(toStart); - else - return toOrig; + return toOrig; } var out = ''; |