Skip to content

Commit

Permalink
path: fix win32 parse regression
Browse files Browse the repository at this point in the history
This fixes the parse function for single character input that are not
a path separator.

PR-URL: #26912
Fixes: #26911
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
BridgeAR authored and targos committed Mar 30, 2019
1 parent a1cf745 commit bd006e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-path-parse-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }],
];

Expand Down

0 comments on commit bd006e1

Please sign in to comment.