Skip to content

Commit bd006e1

Browse files
BridgeARtargos
authored andcommitted
path: fix win32 parse regression
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>
1 parent a1cf745 commit bd006e1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/path.js

+1
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ const win32 = {
830830
ret.root = ret.dir = path;
831831
return ret;
832832
}
833+
ret.base = ret.name = path;
833834
return ret;
834835
}
835836
// Try to match a root

test/parallel/test-path-parse-format.js

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const winPaths = [
5151
];
5252

5353
const winSpecialCaseParseTests = [
54+
['t', { base: 't', name: 't', root: '', dir: '', ext: '' }],
5455
['/foo/bar', { root: '/', dir: '/foo', base: 'bar', ext: '', name: 'bar' }],
5556
];
5657

0 commit comments

Comments
 (0)