We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cb7e86b + 6f00f7d commit 6411b81Copy full SHA for 6411b81
Foundation/Process.swift
@@ -445,7 +445,10 @@ open class Process: NSObject {
445
environment["PWD"] = currentDirectoryURL.path
446
}
447
448
- let szEnvironment: String = environment.map { $0.key + "=" + $0.value }.joined(separator: "\0")
+ // NOTE(compnerd) the environment string must be terminated by a double
449
+ // null-terminator. Otherwise, CreateProcess will fail with
450
+ // INVALID_PARMETER.
451
+ let szEnvironment: String = environment.map { $0.key + "=" + $0.value }.joined(separator: "\0") + "\0\0"
452
453
let sockets: (first: SOCKET, second: SOCKET) = _socketpair()
454
0 commit comments