OSDN Git Service

[Support] Fix argv string escape bug on Windows
authorReid Kleckner <reid@kleckner.net>
Mon, 22 Apr 2013 19:03:55 +0000 (19:03 +0000)
committerReid Kleckner <reid@kleckner.net>
Mon, 22 Apr 2013 19:03:55 +0000 (19:03 +0000)
commit0b675d88309bdcbb387bbee907c4ef9d98e412a2
treea0cb0b64341e572f825489c0c58d41782ed5d517
parent4974b972e7dd94fad74ada4df32a12aba09c4de0
[Support] Fix argv string escape bug on Windows

Summary:
This is http://llvm.org/PR15802.  Backslashes preceding double quotes in
arguments must be escaped.  The interesting bit is that all other
backslashes should *not* be escaped, because the un-escaping logic is
only triggered by the presence of a double quote character.

Reviewers: Bigcheese

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D705

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180035 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Windows/Program.inc
unittests/Support/CMakeLists.txt
unittests/Support/ProgramTest.cpp [new file with mode: 0755]