Skip to content

Commit 609d90b

Browse files
huseyinacacak-janeatargos
authored andcommitted
path: fix toNamespacedPath on Windows
PR-URL: #52915 Fixes: #30224 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 1f3634e commit 609d90b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/path.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ const win32 = {
647647
return `\\\\?\\${resolvedPath}`;
648648
}
649649

650-
return path;
650+
return resolvedPath;
651651
},
652652

653653
/**

test/parallel/test-path-makelong.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ assert.strictEqual(path.win32.toNamespacedPath('\\\\foo\\bar'),
7979
'\\\\?\\UNC\\foo\\bar\\');
8080
assert.strictEqual(path.win32.toNamespacedPath('//foo//bar'),
8181
'\\\\?\\UNC\\foo\\bar\\');
82-
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo');
82+
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo\\');
83+
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\c:\\Windows/System'), '\\\\?\\c:\\Windows\\System');
8384
assert.strictEqual(path.win32.toNamespacedPath(null), null);
8485
assert.strictEqual(path.win32.toNamespacedPath(true), true);
8586
assert.strictEqual(path.win32.toNamespacedPath(1), 1);

0 commit comments

Comments
 (0)