-
Couldn't load subscription status.
- Fork 320
Add logic to split command line arguments on Windows #1028
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
Add logic to split command line arguments on Windows #1028
Conversation
|
@swift-ci Please test |
Previously, we were splitting command line arguments on Windows using the same rules as on Unix, which was incorrect, most importantly because backslashes in the first component of a Windows command line invocation are not escaping anything but interpreted verbatim. Fixes swiftlang#1020 rdar://120809063
b4573e9 to
cfea672
Compare
|
@swift-ci Please test |
|
@swift-ci test windows |
|
@swift-ci Please test Windows |
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.
Going to be honest, I mostly glazed over the actually implementation (especially because most of it is red due to the syntax highlighting currently). The tests looked mostly reasonable from the comments though.
| assertEscapedCommand(#"" test with "" quote""#, [" test with quote"], windows: [#" test with " quote"#]) | ||
| assertEscapedCommand(#"" test with "" quote""#, [" test with quote"], windows: [#" test with " quote"#]) |
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.
Identical?
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.
No, Unix has with quote, Windows has with " quote (double "" results in an escaped " on Windows and an empty String on Unix)
Previously, we were splitting command line arguments on Windows using the same rules as on Unix, which was incorrect, most importantly because backslashes in the first component of a Windows command line invocation are not escaping anything but interpreted verbatim.
The unix command line splitting remains completely unchanged, I just moved it to a different files. Similarly, the assertions for Unix command line splitting remain the same, I just moved the test cases and restructured them slightly.
Fixes #1020
rdar://120809063