Bug 1606596 Comment 10 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Mike Hommey [:glandium] from comment #8)
> I wonder at what stage of the command line "parsing" we end up considering what was supposed to be passed as one argument as multiple ones, including flags.

I expect it's just that we get the arguments' argv/argc combo in `main()` with the wrong values? The docs at https://docs.microsoft.com/en-us/cpp/cpp/main-function-command-line-args?view=vs-2019#parsing-c-command-line-arguments (and the sad tales at https://docs.microsoft.com/en-gb/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way ) seem to suggest that to me, but I could be wrong about that.

Would we be able to usefully put things back together at that point, in a way that wouldn't break legitimate uses? It seems pretty audacious to be claiming we can do the arg parsing better than the OS, especially if information (about escaping etc.) already got thrown away when the URL was initially passed by the OS. Nathan, what do you think?
(In reply to Mike Hommey [:glandium] from comment #8)
> I wonder at what stage of the command line "parsing" we end up considering what was supposed to be passed as one argument as multiple ones, including flags.

I expect it's just that we get the arguments' argv/argc combo in `main()` with the wrong values? The docs at https://docs.microsoft.com/en-us/cpp/cpp/main-function-command-line-args?view=vs-2019#parsing-c-command-line-arguments (and the sad tales at https://docs.microsoft.com/en-gb/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way ) seem to suggest that to me, but I could be wrong about that. (to offer slightly more detail: the double quotes in the file path seem to cause the subsequent arguments to be parsed as individual arguments by the C++ runtime / Windows / whatever -- rather than as a single string, which is how they were intended)

Would we be able to usefully put things back together at that point, in a way that wouldn't break legitimate uses? It seems pretty audacious to be claiming we can do the arg parsing better than the OS, especially if information (about escaping etc.) already got thrown away when the URL was initially passed by the OS. Nathan, what do you think?

Back to Bug 1606596 Comment 10