[llvm-commits] [llvm] r124945 - /llvm/trunk/lib/Support/Windows/Program.inc

NAKAMURA Takumi geek4civic at gmail.com
Sat Feb 5 00:53:12 PST 2011


Author: chapuni
Date: Sat Feb  5 02:53:12 2011
New Revision: 124945

URL: http://llvm.org/viewvc/llvm-project?rev=124945&view=rev
Log:
Windows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or MSYS shell) are included to invoke CreateProcess(). Thanks to Danil Malyshev.

Modified:
    llvm/trunk/lib/Support/Windows/Program.inc

Modified: llvm/trunk/lib/Support/Windows/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Program.inc?rev=124945&r1=124944&r2=124945&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Program.inc (original)
+++ llvm/trunk/lib/Support/Windows/Program.inc Sat Feb  5 02:53:12 2011
@@ -137,7 +137,7 @@
 /// ArgNeedsQuotes - Check whether argument needs to be quoted when calling
 /// CreateProcess.
 static bool ArgNeedsQuotes(const char *Str) {
-  return Str[0] == '\0' || strchr(Str, ' ') != 0;
+  return Str[0] == '\0' || strpbrk(Str, "\t \"&\'()*<>\\`^|") != 0;
 }
 
 





More information about the llvm-commits mailing list