fix(windows): accept ordinary drive path separators (#791)

This commit is contained in:
N0zoM1z0
2026-10-07 03:51:59 +08:00
committed by GitHub
parent d2aed172ab
commit b62931f833
8 changed files with 94 additions and 10 deletions
+3 -1
View File
@@ -62,7 +62,9 @@ export class WindowsOwnedProcess extends EventEmitter {
.filter((entry): entry is [string, string] => entry[1] !== undefined)
.map(([key, value]) => `${key}=${value}`);
const line = [
quoteWindowsProcessArgument(command),
// cmd.exe parses its own command line rather than the CRT argv rules;
// its executable token must match the native drive-path representation.
quoteWindowsProcessArgument(command.replaceAll("/", "\\")),
...arguments_.map((value) =>
verbatim ? value : quoteWindowsProcessArgument(value),
),