Skip to content

Commit e12f48e

Browse files
BridgeARzhangyongsheng
authored and
zhangyongsheng
committed
path: move branch to the correct location
This code branch only makes sense when i === length. Otherwise it'll already be handled. PR-URL: #28556 Fixes: #28549 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 5a6aa66 commit e12f48e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/path.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,11 @@ const win32 = {
518518
lastCommonSep = 3;
519519
}
520520
}
521+
if (lastCommonSep === -1)
522+
lastCommonSep = 0;
521523
}
522524

523525
let out = '';
524-
if (lastCommonSep === -1)
525-
lastCommonSep = 0;
526526
// Generate the relative path based on the path difference between `to` and
527527
// `from`
528528
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {

0 commit comments

Comments
 (0)