Windows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 5 Feb 2011 08:53:12 +0000 (08:53 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Sat, 5 Feb 2011 08:53:12 +0000 (08:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124945 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Windows/Program.inc

index 0b92c78dc895394ba5f8eb34ebd7a3e0c6b37807..f83ba64a8ddc8cc7d7d19e4e74752867329a4e60 100644 (file)
@@ -137,7 +137,7 @@ static HANDLE RedirectIO(const Path *path, int fd, std::string* ErrMsg) {
 /// 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;
 }