summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-11 15:57:39 (GMT)
committerBrad King <brad.king@kitware.com>2013-01-11 15:57:39 (GMT)
commit8ff1d4714fb7cd42eb3cd8db041b529e433eb7c8 (patch)
tree0df377a2dee34cdd9ad864274627bfd6ce00f84f
parent5929086634e362d03d02124eea5ee14919ae5a0f (diff)
downloadCMake-8ff1d4714fb7cd42eb3cd8db041b529e433eb7c8.zip
CMake-8ff1d4714fb7cd42eb3cd8db041b529e433eb7c8.tar.gz
CMake-8ff1d4714fb7cd42eb3cd8db041b529e433eb7c8.tar.bz2
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.
-rw-r--r--Source/cmake.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index a44c825..0acd2fc 100644
--- a/Source/cmake.cxx
+++ b/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);