path.relative() not working with network shares

As noted in issue 6401, path.relative() don't work with network shares.

The problem was that on line 272 "Array.slice(start, end)" was wrongly used. The end parameter must be the index until where the array should be spliced and not the length.