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: nodejs#28556
Fixes: nodejs#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 ZYSzys committed Jul 14, 2019
1 parent 5a6aa66 commit e12f48e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/path.js
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 e12f48e

Please sign in to comment.