This patch against next (because the offending patch is not in master yet) 
fixes one cause of the valgrind warnings Bill reported recently. It doesn't 
fix the C++ code, it only fixes the module that accidentially spotted this by 
a bug in itself.

Eike
>From d52761d236cf7cfee7743ac283df52af0ac64acc Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <e...@sf-mail.de>
Date: Fri, 18 Nov 2011 16:14:54 +0100
Subject: [PATCH] fix matching output of "bison --version"

The output may contain semicolons, which will confuse the IF() because of
missing quoting.
---
 Modules/FindBISON.cmake |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index 25fd51d..edde9eb 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -68,11 +68,11 @@ IF(BISON_EXECUTABLE)
     MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
   ELSE()
     # Bison++
-    IF(${BISON_version_output} MATCHES "^bison\\+\\+")
+    IF("${BISON_version_output}" MATCHES "^bison\\+\\+")
       STRING(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
         BISON_VERSION "${BISON_version_output}")
     # GNU Bison
-    ELSEIF(${BISON_version_output} MATCHES "^bison[^+]")
+    ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]")
       STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
         BISON_VERSION "${BISON_version_output}")
     ELSE()
-- 
1.7.7.3

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to