-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement Missing Command Line Quoting on Windows #2032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Foundation/Process.swift
Outdated
var command: [String] = [launchPath] | ||
if let arguments = self.arguments { | ||
command.append(contentsOf: arguments) | ||
} | ||
command = command.map(quoteWindowsCommandArg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please keep the transformation of the [String]
input to the final String
passed to the native API, localized to a single function call? Like:
private func quoteWindowsCommandLine(_ commandLine: [String]) -> String {
func quoteWindowsCommandArg(arg: String) -> String { /* ... */ }
return commandLine.map(quoteWindowsCommandArg).joined(separator: " ")
}
Foundation/Process.swift
Outdated
@@ -102,6 +102,62 @@ private func processIsEqual(_ a : UnsafeRawPointer?, _ b : UnsafeRawPointer?) -> | |||
return true | |||
} | |||
|
|||
#if os(Windows) | |||
private func quoteWindowsCommandArg(arg: String) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the trailing semicolons from within this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, that's what I get for copying c++ code without thinking about it.
a650fab
to
a257b03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@swift-ci please test |
Seems like something else failed?
|
@swift-ci please test |
No description provided.