From 8ff1d4714fb7cd42eb3cd8db041b529e433eb7c8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 11 Jan 2013 10:57:39 -0500 Subject: 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. --- Source/cmake.cxx | 6 ++++++ 1 file changed, 6 insertions(+) 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& 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); -- cgit v0.12