summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/Program.inc
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-02-05 08:53:12 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-02-05 08:53:12 +0000
commit3e600a29d31e7dd6212f91f9203d4d19ec48235c (patch)
tree2b3072a51d7025e51c68c7bcdaa31a748c4f9732 /llvm/lib/Support/Windows/Program.inc
parent068d16b4df513920ae0fe0e8be656c63f46fbf6b (diff)
downloadbcm5719-llvm-3e600a29d31e7dd6212f91f9203d4d19ec48235c.tar.gz
bcm5719-llvm-3e600a29d31e7dd6212f91f9203d4d19ec48235c.zip
Windows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or MSYS shell) are included to invoke CreateProcess(). Thanks to Danil Malyshev.
llvm-svn: 124945
Diffstat (limited to 'llvm/lib/Support/Windows/Program.inc')
-rw-r--r--llvm/lib/Support/Windows/Program.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Windows/Program.inc b/llvm/lib/Support/Windows/Program.inc
index 0b92c78dc89..f83ba64a8dd 100644
--- a/llvm/lib/Support/Windows/Program.inc
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud