openbsd-ports/devel/cmake/patches/patch-Source_cmake_cxx
dcoppa ec9f3212ec Fix a couple of crashers, from upstream:
Bugfix: don't crash when a target is expected but is not available
(upstream git commit e767ffcda58ab73cf2c4394202eec7ae1f6035b5)

Bugfix: don't crash if the link.txt file contains empty lines
(upstream git commit 8ff1d4714fb7cd42eb3cd8db041b529e433eb7c8)
2013-01-18 22:17:06 +00:00

21 lines
721 B
Plaintext

$OpenBSD: patch-Source_cmake_cxx,v 1.8 2013/01/18 22:17:06 dcoppa Exp $
Bugfix: don't crash if the link.txt file contains empty lines
(upstream git commit 8ff1d4714fb7cd42eb3cd8db041b529e433eb7c8)
--- Source/cmake.cxx.orig Tue Nov 27 14:26:33 2012
+++ Source/cmake.cxx Fri Jan 18 16:18:31 2013
@@ -3299,6 +3299,12 @@ int cmake::ExecuteLinkScript(std::vector<std::string>&
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);