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.

Fixes: nodejs#26911
  • Loading branch information
BridgeAR committed Mar 26, 2019
1 parent 08470bf commit 2e508e9
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 2e508e9

Please sign in to comment.