diff --git a/lib/path.js b/lib/path.js index f7a8612933a..e278c891482 100644 --- a/lib/path.js +++ b/lib/path.js @@ -518,11 +518,11 @@ const win32 = { lastCommonSep = 3; } } + if (lastCommonSep === -1) + lastCommonSep = 0; } let out = ''; - if (lastCommonSep === -1) - lastCommonSep = 0; // Generate the relative path based on the path difference between `to` and // `from` for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {