mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
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
This commit is contained in:
@@ -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
|
/// ArgNeedsQuotes - Check whether argument needs to be quoted when calling
|
||||||
/// CreateProcess.
|
/// CreateProcess.
|
||||||
static bool ArgNeedsQuotes(const char *Str) {
|
static bool ArgNeedsQuotes(const char *Str) {
|
||||||
return Str[0] == '\0' || strchr(Str, ' ') != 0;
|
return Str[0] == '\0' || strpbrk(Str, "\t \"&\'()*<>\\`^|") != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user