Skip to content

wil::ArgvToCommandLine does not quote empty arguments #562

@ai4rei

Description

@ai4rei

When wil::ArgvToCommandLine is called without ArgvToCommandLineFlags::ForceQuotes, then empty arguments aren't quoted, which causes that argument to be lost in resulting command line.

For example

char const* const argv[] =
{
    "first",
    "",
    "third",
};

auto commandLine = wil::ArgvToCommandLine(_countof(argv), argv);

The expected commandLine would be "first \"\" third", but it's "first third" instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions