Skip to content
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 10 commits into from
Jun 24, 2023
Merged

Update quoting for CMD #986

merged 10 commits into from
Jun 24, 2023

Commits on Jun 22, 2023

  1. 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.
    ericcornelissen committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    acd428c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7649327 View commit details
    Browse the repository at this point in the history
  3. Clean up cmd.js

    (and correct `getExpectedOutput`  for Unix shells.)
    ericcornelissen committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    73e31c3 View commit details
    Browse the repository at this point in the history
  4. Do quote for CMD!

    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.
    ericcornelissen committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    c3bb4c7 View commit details
    Browse the repository at this point in the history
  5. Update the changelog

    ericcornelissen committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    f5f51cc View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2023

  1. 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.
    ericcornelissen committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    6b548ff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dbfecff View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2023

  1. Update tests for quoting

    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.
    ericcornelissen committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    70a2c50 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ade104 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4855d71 View commit details
    Browse the repository at this point in the history