[PATCH] D88401: [lib/Support/CommandLine][windows] - Handle "\ " as a space token.

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 16:40:15 PDT 2020


amccarth added a comment.

In D88401#2300043 <https://reviews.llvm.org/D88401#2300043>, @grimar wrote:

> I believe that windows tokenizer implements this:
> https://docs.microsoft.com/en-us/previous-versions//17w5ykft(v=vs.85)?redirectedfrom=MSDN

Despite being marked as deprecated, I believe the documentation behind that link is accurate.

Unfortunately, Windows has (at least) two command line tokenizers.

One is `GetCommandLineArgvW`:  https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw

The other is built into the MS implementation of the C run-time library (which you get if you take the argument vector passed into `main`).

They behave nearly the same except in how they handle some edge cases related to backslashes and multiple levels of quotation marks.  I think this Raymond Chen blog post gets into some of those issues:    https://devblogs.microsoft.com/oldnewthing/20100917-00/?p=12833


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88401/new/

https://reviews.llvm.org/D88401



More information about the llvm-commits mailing list