3 ms·
> it's up to the application or C library to tokenize it Technically yes, but practically the only correct way to tokenize these command line strings is Comma
by Const-me 2y ago
> it's up to the application or C library to tokenize it
Technically yes, but practically the only correct way to tokenize these command line strings is CommandLineToArgvW WinAPI implemented by Shell32.dll.
- jasomill 2y agoThis is fine for parsing command line arguments in your own programs, but unhelpful when attempting to provide a mechanism to reliably pass a user-supplied argument list to an arbitrary external program that is free to interpret the string returned by GetCommandLine arbitrarily (so the notion of "passing a list of arguments" isn't even generally applicable). cmd.exe is an important and terrible example: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd#remarks https://learn.microsoft.com/en-us/windows-server/administrat...
- asveikau 2y agoWithin Microsoft when I was there, it was considered taboo to introduce a dependency to shell32 where it did not already exist. I tried to add a call to CommandLineToArgvW once and it got flagged. From the part of Microsoft that was focused on cleaning up the windows code base in that era, the shell was not considered a core component. All of the utility functions that it provides like this were considered baggage, improper layering, poor design.