소스 검색

BUG: Enabled use of EscapeForShell to properly escape custom command lines. This addresses bug#3786 for Xcode.

Brad King 19 년 전
부모
커밋
b9fc06735d
2개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 1
      Source/cmGlobalXCodeGenerator.cxx
  2. 2 2
      Source/cmLocalGenerator.h

+ 2 - 1
Source/cmGlobalXCodeGenerator.cxx

@@ -1037,7 +1037,8 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
         for(unsigned int j=1; j < commandLine.size(); ++j)
           {
           cmd += " ";
-          cmd += cmSystemTools::EscapeSpaces(commandLine[j].c_str());
+          cmd += (this->CurrentLocalGenerator
+                  ->EscapeForShell(commandLine[j].c_str()));
           }
         makefileStream << "\t" << cmd.c_str() << "\n";
         }

+ 2 - 2
Source/cmLocalGenerator.h

@@ -201,12 +201,12 @@ public:
     const char* LanguageCompileFlags;
   };
 
-protected:
-
   /** Escape the given string to be used as a command line argument in
       the native build system shell.  */
   std::string EscapeForShell(const char* str);
 
+protected:
+
   /** Construct a comment for a custom command.  */
   std::string ConstructComment(const cmCustomCommand& cc,
                                const char* default_comment = "");