Преглед на файлове

CMake: Skip empty link.txt lines (#13845)

In the implementation of "cmake -E cmake_link_script", skip lines from
the input file that are empty or contain only whitespace.  Do not try to
run a child with no command line.
Brad King преди 13 години
родител
ревизия
8ff1d4714f
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      Source/cmake.cxx

+ 6 - 0
Source/cmake.cxx

@@ -3299,6 +3299,12 @@ int cmake::ExecuteLinkScript(std::vector<std::string>& args)
   int result = 0;
   while(result == 0 && cmSystemTools::GetLineFromStream(fin, command))
     {
+    // Skip empty command lines.
+    if(command.find_first_not_of(" \t") == command.npos)
+      {
+      continue;
+      }
+
     // Setup this command line.
     const char* cmd[2] = {command.c_str(), 0};
     cmsysProcess_SetCommand(cp, cmd);