diff options
author | Sunil Srivastava <sunil_srivastava@playstation.sony.com> | 2019-03-14 19:26:04 +0000 |
---|---|---|
committer | Sunil Srivastava <sunil_srivastava@playstation.sony.com> | 2019-03-14 19:26:04 +0000 |
commit | 6823c823d198b60f6590f5348d5a57b3e96c57ad (patch) | |
tree | ff1c53e0631c089d0ebd24bd36fc1431d1d4dfde /llvm/lib/Support/CommandLine.cpp | |
parent | de1d5d3675992a60c95b17d70ea817468883c485 (diff) | |
download | bcm5719-llvm-6823c823d198b60f6590f5348d5a57b3e96c57ad.tar.gz bcm5719-llvm-6823c823d198b60f6590f5348d5a57b3e96c57ad.zip |
Handle consecutive-double-quotes in Windows argument parsing
Windows command line argument processing treats consecutive double quotes
as a single double-quote. This patch implements this functionality.
Differential Revision: https://reviews.llvm.org/D58662
llvm-svn: 356193
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 39991a8905d..c1193f90e8f 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -874,6 +874,13 @@ void cl::TokenizeWindowsCommandLine(StringRef Src, StringSaver &Saver, // QUOTED state means that it's reading a token quoted by double quotes. if (State == QUOTED) { if (C == '"') { + if (I < (E - 1) && Src[I + 1] == '"') { + // Consecutive double-quotes inside a quoted string implies one + // double-quote. + Token.push_back('"'); + I = I + 1; + continue; + } State = UNQUOTED; continue; } |