summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-04-29 19:34:49 (GMT)
committerBrad King <brad.king@kitware.com>2008-04-29 19:34:49 (GMT)
commitc7d84b21c636a559b1f1a87735ce12d21f4a9dcd (patch)
treef63d1ac44651bfeb21a82c614d7c6c8155cbffbd /Source/cmLocalGenerator.cxx
parent3344ce9197926f262fa4eed30f085d72b08af744 (diff)
downloadCMake-c7d84b21c636a559b1f1a87735ce12d21f4a9dcd.zip
CMake-c7d84b21c636a559b1f1a87735ce12d21f4a9dcd.tar.gz
CMake-c7d84b21c636a559b1f1a87735ce12d21f4a9dcd.tar.bz2
BUG: Do not escape shell operators when generating command lines.
- See bug#6868. - Update CustomCommand test to check.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx23
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)