diff --git a/lib/path.js b/lib/path.js index 1a2b3e38eca03f..71bc231bd6df94 100644 --- a/lib/path.js +++ b/lib/path.js @@ -647,7 +647,7 @@ const win32 = { return `\\\\?\\${resolvedPath}`; } - return path; + return resolvedPath; }, /** diff --git a/test/parallel/test-path-makelong.js b/test/parallel/test-path-makelong.js index b0a4ebc6b30b62..7a4783953c8fde 100644 --- a/test/parallel/test-path-makelong.js +++ b/test/parallel/test-path-makelong.js @@ -79,7 +79,8 @@ assert.strictEqual(path.win32.toNamespacedPath('\\\\foo\\bar'), '\\\\?\\UNC\\foo\\bar\\'); assert.strictEqual(path.win32.toNamespacedPath('//foo//bar'), '\\\\?\\UNC\\foo\\bar\\'); -assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo'); +assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo\\'); +assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\c:\\Windows/System'), '\\\\?\\c:\\Windows\\System'); assert.strictEqual(path.win32.toNamespacedPath(null), null); assert.strictEqual(path.win32.toNamespacedPath(true), true); assert.strictEqual(path.win32.toNamespacedPath(1), 1);