@@ -1405,26 +1405,21 @@ var Minimatch = class { |
1405 | 1405 | matchOne(file, pattern, partial = false) { |
1406 | 1406 | const options = this.options; |
1407 | 1407 | if (this.isWindows) { |
1408 | | - const fileUNC = file[0] === "" && file[1] === "" && file[2] === "?" && typeof file[3] === "string" && /^[a-z]:$/i.test(file[3]); |
1409 | | - const patternUNC = pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]); |
1410 | | - if (fileUNC && patternUNC) { |
1411 | | - const fd = file[3]; |
1412 | | - const pd = pattern[3]; |
| 1408 | + const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]); |
| 1409 | + const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]); |
| 1410 | + const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]); |
| 1411 | + const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]); |
| 1412 | + const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0; |
| 1413 | + const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0; |
| 1414 | + if (typeof fdi === "number" && typeof pdi === "number") { |
| 1415 | + const [fd, pd] = [file[fdi], pattern[pdi]]; |
1413 | 1416 | if (fd.toLowerCase() === pd.toLowerCase()) { |
1414 | | - file[3] = pd; |
1415 | | - } |
1416 | | - } else if (patternUNC && typeof file[0] === "string") { |
1417 | | - const pd = pattern[3]; |
1418 | | - const fd = file[0]; |
1419 | | - if (pd.toLowerCase() === fd.toLowerCase()) { |
1420 | | - pattern[3] = fd; |
1421 | | - pattern = pattern.slice(3); |
1422 | | - } |
1423 | | - } else if (fileUNC && typeof pattern[0] === "string") { |
1424 | | - const fd = file[3]; |
1425 | | - if (fd.toLowerCase() === pattern[0].toLowerCase()) { |
1426 | | - pattern[0] = fd; |
1427 | | - file = file.slice(3); |
| 1417 | + pattern[pdi] = fd; |
| 1418 | + if (pdi > fdi) { |
| 1419 | + pattern = pattern.slice(pdi); |
| 1420 | + } else if (fdi > pdi) { |
| 1421 | + file = file.slice(fdi); |
| 1422 | + } |
1428 | 1423 | } |
1429 | 1424 | } |
1430 | 1425 | } |
|