diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 88f5e80..9c183fc 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2545,9 +2545,32 @@ std::string cmLocalGenerator::EscapeForShellOldStyle(const char* str) } //---------------------------------------------------------------------------- +static bool cmLocalGeneratorIsShellOperator(const char* str) +{ + if(strcmp(str, "<") == 0 || + strcmp(str, ">") == 0 || + strcmp(str, "<<") == 0 || + strcmp(str, ">>") == 0 || + strcmp(str, "|") == 0 || + strcmp(str, "&>") == 0 || + strcmp(str, "2>&1") == 0 || + strcmp(str, "1>&2") == 0) + { + return true; + } + return false; +} + +//---------------------------------------------------------------------------- std::string cmLocalGenerator::EscapeForShell(const char* str, bool makeVars, bool forEcho) { + // Do not escape shell operators. + if(cmLocalGeneratorIsShellOperator(str)) + { + return str; + } + // Compute the flags for the target shell environment. int flags = 0; if(this->WindowsVSIDE) |