From bd006e1002c634e1c80065f6de10c9c1989270c2 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 26 Mar 2019 02:45:59 +0100 Subject: [PATCH] path: fix win32 parse regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the parse function for single character input that are not a path separator. PR-URL: https://github.com/nodejs/node/pull/26912 Fixes: https://github.com/nodejs/node/issues/26911 Reviewed-By: Ben Noordhuis Reviewed-By: Michaƫl Zasso --- lib/path.js | 1 + test/parallel/test-path-parse-format.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/path.js b/lib/path.js index 6ac65cfe4a7a3f..9ac877eabcaf44 100644 --- a/lib/path.js +++ b/lib/path.js @@ -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 diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js index 0487ece8c43b58..5d6c8c6953cfcc 100644 --- a/test/parallel/test-path-parse-format.js +++ b/test/parallel/test-path-parse-format.js @@ -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' }], ];