| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 15e547b commit f667215
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,7 @@ | |||
| 24 | 24 | const { | |
| 25 | 25 | ArrayPrototypeIncludes, | |
| 26 | 26 | ArrayPrototypeJoin, | |
| 27 | + ArrayPrototypePush, | ||
| 27 | 28 | ArrayPrototypeSlice, | |
| 28 | 29 | FunctionPrototypeBind, | |
| 29 | 30 | StringPrototypeCharCodeAt, | |
@@ -506,22 +507,21 @@ const win32 = { | |||
| 506 | 507 | if (args.length === 0) | |
| 507 | 508 | return '.'; | |
| 508 | 509 | ||
| 509 | - let joined; | ||
| 510 | - let firstPart; | ||
| 510 | + const path = []; | ||
| 511 | 511 | for (let i = 0; i < args.length; ++i) { | |
| 512 | 512 | const arg = args[i]; | |
| 513 | 513 | validateString(arg, 'path'); | |
| 514 | 514 | if (arg.length > 0) { | |
| 515 | - if (joined === undefined) | ||
| 516 | - joined = firstPart = arg; | ||
| 517 | - else | ||
| 518 | - joined += `\\${arg}`; | ||
| 515 | + ArrayPrototypePush(path, arg); | ||
| 519 | 516 | } | |
| 520 | 517 | } | |
| 521 | 518 | ||
| 522 | - if (joined === undefined) | ||
| 519 | + if (path.length === 0) | ||
| 523 | 520 | return '.'; | |
| 524 | 521 | ||
| 522 | + const firstPart = path[0]; | ||
| 523 | + let joined = ArrayPrototypeJoin(path, '\\'); | ||
| 524 | + | ||
| 525 | 525 | // Make sure that the joined path doesn't start with two slashes, because | |
| 526 | 526 | // normalize() will mistake it for a UNC path then. | |
| 527 | 527 | // | |
| Back | FazBrowse Home | New Git URL |
0 commit comments