Skip to content

Commit 13ab832

Browse files
committed
Address feedback, note ADO issue number for command line escaping
1 parent db980db commit 13ab832

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Sources/Testing/ExitTests/ExitTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public struct ExitTest: Sendable {
7171
/// - Returns: A file handle open for writing to which events should be
7272
/// written, or `nil` if the file handle could not be resolved.
7373
private static func _findBackChannel() -> FileHandle? {
74-
guard let backChannelEnvironmentVariable = Environment.variable(named: "SWT_EXPERIMENTAL_BACKCHANNEL_FD") else {
74+
guard let backChannelEnvironmentVariable = Environment.variable(named: "SWT_EXPERIMENTAL_BACKCHANNEL") else {
7575
return nil
7676
}
7777

@@ -407,7 +407,7 @@ extension ExitTest {
407407
#warning("Platform-specific implementation missing: back-channel pipe unavailable")
408408
#endif
409409
if let backChannelEnvironmentVariable {
410-
childEnvironment["SWT_EXPERIMENTAL_BACKCHANNEL_FD"] = backChannelEnvironmentVariable
410+
childEnvironment["SWT_EXPERIMENTAL_BACKCHANNEL"] = backChannelEnvironmentVariable
411411
}
412412

413413
// Spawn the child process.

Sources/Testing/ExitTests/SpawnProcess.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func spawnExecutable(
157157
)
158158

159159
let commandLine = _escapeCommandLine(CollectionOfOne(executablePath) + arguments)
160-
let environ = environment.map { "\($0.key)=\($0.value)"}.joined(separator: "\0") + "\0\0"
160+
let environ = environment.map { "\($0.key)=\($0.value)" }.joined(separator: "\0") + "\0\0"
161161

162162
return try commandLine.withCString(encodedAs: UTF16.self) { commandLine in
163163
try environ.withCString(encodedAs: UTF16.self) { environ in
@@ -248,7 +248,8 @@ private func _withStartupInfoEx<R>(attributeCount: Int = 0, _ body: (UnsafeMutab
248248
/// Windows processes are responsible for handling their own command-line
249249
/// escaping. This function is adapted from the code in
250250
/// swift-corelibs-foundation (see `quoteWindowsCommandLine()`) which was
251-
/// itself adapted from code [published by Microsoft](https://learn.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way).
251+
/// itself adapted from code [published by Microsoft](https://learn.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way)
252+
/// (ADO 8992662).
252253
private func _escapeCommandLine(_ arguments: [String]) -> String {
253254
return arguments.lazy
254255
.map { arg in

0 commit comments

Comments
 (0)