Skip to content

CommandLineToArgvW has different behavior than SegmentCommandLine #77644

Closed
@carlreinke

Description

@carlreinke

#70608 replaced use of SegmentCommandLine with a call to CommandLineToArgvW, but the algorithms are slightly different.

Given the input test.exe a"b"" c d (example taken from here):

Method [1] [2] [3]
SegmentCommandLine ab" c d
CommandLineToArgvW ab" c d

The comment on SegmentCommandLine claimed that it "mimics [...] CommandLineToArgvW", but it actually mimicked what MSVCRT does before main, which is slightly different.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions