Skip to content

Commit 84da6a5

Browse files
huseyinacacak-janeamarco-ippolito
authored andcommitted
path: fix toNamespacedPath on Windows
PR-URL: #52915 Fixes: #30224 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 26775c5 commit 84da6a5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/path.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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)