diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-02-05 08:53:12 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-02-05 08:53:12 +0000 |
commit | 0f0889e24b6521fafeea7d2ab17bd14897773e0c (patch) | |
tree | ede4b41db7dc7607a63fcf3692663b407917f0ab /lib/Support/Windows/Program.inc | |
parent | 782b57674960833b13c1844a917c0294810df18a (diff) | |
download | external_llvm-0f0889e24b6521fafeea7d2ab17bd14897773e0c.zip external_llvm-0f0889e24b6521fafeea7d2ab17bd14897773e0c.tar.gz external_llvm-0f0889e24b6521fafeea7d2ab17bd14897773e0c.tar.bz2 |
Windows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or MSYS shell) are included to invoke CreateProcess(). Thanks to Danil Malyshev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124945 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Program.inc')
-rw-r--r-- | lib/Support/Windows/Program.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/Windows/Program.inc b/lib/Support/Windows/Program.inc index 0b92c78..f83ba64 100644 --- a/lib/Support/Windows/Program.inc +++ b/lib/Support/Windows/Program.inc @@ -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; } |