From 3cf1ffebabf0f6a862ea80cd9cf14adbd073b3ef 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 6ac65cfe4a7..9ac877eabca 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 09f6bb0e9d8..901bdb0b93d 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' }], ];