Package: mydumper / 0.5.1-3

0006-fix-runaway-regexp-in-in-cmake.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Mateusz Kijowski <mkijowski@trojmiasto.pl>
Date: Mon, 21 May 2012 11:03:42 +0200
Subject: fix runaway regexp in in cmake

---
 cmake/modules/FindMySQL.cmake |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake
index b3d038c..488ffc9 100644
--- a/cmake/modules/FindMySQL.cmake
+++ b/cmake/modules/FindMySQL.cmake
@@ -47,7 +47,9 @@ if(UNIX)
 
         set(MYSQL_ADD_LIBRARIES "")
 
-        string(REGEX MATCHALL "-l[^ ]*" MYSQL_LIB_LIST "${MY_TMP}")
+        # prepend space in order to match separate words only (e.g. rather
+        # than "-linux" from within "-L/usr/lib/i386-linux-gnu")
+        string(REGEX MATCHALL " +-l[^ ]*" MYSQL_LIB_LIST " ${MY_TMP}")
         foreach(MY_LIB ${MYSQL_LIB_LIST})
             string(REGEX REPLACE "[ ]*-l([^ ]*)" "\\1" MY_LIB "${MY_LIB}")
             list(APPEND MYSQL_ADD_LIBRARIES "${MY_LIB}")
@@ -55,7 +57,7 @@ if(UNIX)
 
         set(MYSQL_ADD_LIBRARY_PATH "")
 
-        string(REGEX MATCHALL "-L[^ ]*" MYSQL_LIBDIR_LIST "${MY_TMP}")
+        string(REGEX MATCHALL " +-L[^ ]*" MYSQL_LIBDIR_LIST " ${MY_TMP}")
         foreach(MY_LIB ${MYSQL_LIBDIR_LIST})
             string(REGEX REPLACE "[ ]*-L([^ ]*)" "\\1" MY_LIB "${MY_LIB}")
             list(APPEND MYSQL_ADD_LIBRARY_PATH "${MY_LIB}")