Skip to content

quote_powershell turns an empty argument into a quoted pair of double quotes #89

Description

@kirillDevPro

ShellKind::quote_powershell("") does not produce an empty PowerShell argument.

quote_windows represents an empty argument as "". needs_quoting_powershell is true for the empty string, so quote_powershell then wraps that CRT form in single quotes and returns '""'. In PowerShell a single-quoted '""' is the two-character string of double quotes, not an empty argument.

quote_pwsh("") returns '', which is an empty argument. ShellKind::try_quote uses quote_powershell for ShellKind::PowerShell and quote_pwsh for ShellKind::Pwsh, so the same empty task argument is quoted differently for the two Windows shells. ShellBuilder::build calls try_quote on each task argument.

No regression test was added for the PowerShell result. Pinning '""' would freeze this behaviour.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions