[Cmake-commits] [cmake-commits] king committed cmLocalGenerator.cxx 1.272 1.273

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Apr 29 15:34:39 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv24979/Source

Modified Files:
	cmLocalGenerator.cxx 
Log Message:
BUG: Do not escape shell operators when generating command lines.

  - See bug#6868.
  - Update CustomCommand test to check.


Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.272
retrieving revision 1.273
diff -C 2 -d -r1.272 -r1.273
*** cmLocalGenerator.cxx	29 Apr 2008 16:10:47 -0000	1.272
--- cmLocalGenerator.cxx	29 Apr 2008 19:34:35 -0000	1.273
***************
*** 2546,2552 ****
--- 2546,2575 ----
  
  //----------------------------------------------------------------------------
+ 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;



More information about the Cmake-commits mailing list