瀏覽代碼

BUG: Disable new shell escape code until backward compatibility can be established in the new implementation.

Brad King 19 年之前
父節點
當前提交
c1b4a0bf74
共有 2 個文件被更改,包括 16 次插入1 次删除
  1. 15 0
      Source/cmLocalGenerator.cxx
  2. 1 1
      Tests/CustomCommand/CMakeLists.txt

+ 15 - 0
Source/cmLocalGenerator.cxx

@@ -2246,6 +2246,20 @@ cmLocalGenerator
 std::string cmLocalGenerator::EscapeForShell(const char* str)
 std::string cmLocalGenerator::EscapeForShell(const char* str)
 {
 {
   std::string result;
   std::string result;
+  // Temporarily use old shell escaping code until a means of backward
+  // compatibility can be established in the new implementation.
+#if 1
+  bool forceOn =  cmSystemTools::GetForceUnixPaths();
+  if(forceOn && this->WindowsShell)
+    {
+    cmSystemTools::SetForceUnixPaths(false);
+    }
+  result = cmSystemTools::EscapeSpaces(str);
+  if(forceOn && this->WindowsShell)
+    {
+    cmSystemTools::SetForceUnixPaths(true);
+    }
+#else
   if(this->WindowsShell)
   if(this->WindowsShell)
     {
     {
     int size = cmsysSystem_Windows_ShellArgumentSize(str);
     int size = cmsysSystem_Windows_ShellArgumentSize(str);
@@ -2264,5 +2278,6 @@ std::string cmLocalGenerator::EscapeForShell(const char* str)
       result += *c;
       result += *c;
       }
       }
     }
     }
+#endif
   return result;
   return result;
 }
 }

+ 1 - 1
Tests/CustomCommand/CMakeLists.txt

@@ -199,7 +199,7 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in
                @ONLY IMMEDIATE)
                @ONLY IMMEDIATE)
 ADD_EXECUTABLE(check_command_line
 ADD_EXECUTABLE(check_command_line
   ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c)
   ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c)
-ADD_CUSTOM_TARGET(do_check_command_line ALL
+ADD_CUSTOM_TARGET(do_check_command_line #ALL
   COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line
   COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line
   ${CHECK_ARGS}
   ${CHECK_ARGS}
   )
   )