Skip to content

Commit 5b5c819

Browse files
BridgeARtargos
authored andcommitted
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 <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>
1 parent 18c56df commit 5b5c819

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)