path: fix win32 parse regression

This fixes the parse function for single character input that are not
a path separator.

PR-URL: https://github.com/nodejs/node/pull/26912
Fixes: https://github.com/nodejs/node/issues/26911
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Ruben Bridgewater 2019-03-26 02:45:59 +01:00
parent 4c4ad120c5
commit 3cf1ffebab
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
2 changed files with 2 additions and 0 deletions

View File

@ -830,6 +830,7 @@ const win32 = {
ret.root = ret.dir = path;
return ret;
}
ret.base = ret.name = path;
return ret;
}
// Try to match a root

View File

@ -51,6 +51,7 @@ const winPaths = [
];
const winSpecialCaseParseTests = [
['t', { base: 't', name: 't', root: '', dir: '', ext: '' }],
['/foo/bar', { root: '/', dir: '/foo', base: 'bar', ext: '', name: 'bar' }],
];