-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update quoting for CMD #986
Merged
Merged
Commits on Jun 22, 2023
-
Update quoting for CMD to ... not quote(?)
This commit is a work in progress... CMD quoting is weird - It appears to be necessary to preserve whitespace but you can't disable variable expansion from within quotes (evidenced by the removal of `_common.cjs` line 68 to 70). The main progress of this commit is that it fixes the incorrect escaping of `%` when quoting for CMD. However, it lacks whitespace preservation which should really be kept - and, to reiterate, whitespace preservation is impossible without quoting in CMD, as far as I'm aware.
Configuration menu - View commit details
-
Copy full SHA for acd428c - Browse repository at this point
Copy the full SHA acd428cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7649327 - Browse repository at this point
Copy the full SHA 7649327View commit details -
(and correct `getExpectedOutput` for Unix shells.)
Configuration menu - View commit details
-
Copy full SHA for 73e31c3 - Browse repository at this point
Copy the full SHA 73e31c3View commit details -
Turns out quoting is necessary in CMD for one important reason: to prevent argument splitting. The side affect of quoting whitespace seems to be that, in contrast to escaping for interpolation, double quotes must be escaped differently. Hence, this commit also re-introduces the `escapeArgForQuoted` function. This particular escaping gets a bit confusing when a pre-existing quote is next to a whitespace character because the inserted quotes from the actual quoting have an effect on those pre-existing quotes, so they need to be handled separately.
Configuration menu - View commit details
-
Copy full SHA for c3bb4c7 - Browse repository at this point
Copy the full SHA c3bb4c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5f51cc - Browse repository at this point
Copy the full SHA f5f51ccView commit details
Commits on Jun 23, 2023
-
Improve test fixtures for CMD quoting
- Include cases where there's multiple for CMD. - Cover the caret character (`^`) when quoting for Windows. These cases are based on uncaught mutants.
Configuration menu - View commit details
-
Copy full SHA for 6b548ff - Browse repository at this point
Copy the full SHA 6b548ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for dbfecff - Browse repository at this point
Copy the full SHA dbfecffView commit details
Commits on Jun 24, 2023
-
Per the new quoting strategy for CMD, quoting does not necessarily mean the resulting string has a quote character at the start and end of the string. Thus, remove all such checks from the tests.
Configuration menu - View commit details
-
Copy full SHA for 70a2c50 - Browse repository at this point
Copy the full SHA 70a2c50View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ade104 - Browse repository at this point
Copy the full SHA 8ade104View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4855d71 - Browse repository at this point
Copy the full SHA 4855d71View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.