Skip to content

Commit

Permalink
path: move branch to the correct location
Browse files Browse the repository at this point in the history
This code branch only makes sense when i === length. Otherwise it'll
already be handled.

PR-URL: #28556
Fixes: #28549
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
  • Loading branch information
BridgeAR authored and targos committed Jul 20, 2019
1 parent 18c56df commit 5b5c819
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5b5c819

Please sign in to comment.