path: move branch to the correct location

This code branch only makes sense when i === length. Otherwise it'll
already be handled.

PR-URL: https://github.com/nodejs/node/pull/28556
Fixes: https://github.com/nodejs/node/issues/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>
This commit is contained in:
Ruben Bridgewater 2019-07-05 14:34:25 +02:00 committed by zhangyongsheng
parent 5a6aa66afa
commit e12f48ef07

View File

@ -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) {