summaryrefslogtreecommitdiff
path: root/nano/nano-1.3.0/configure.patch
blob: 62d33639c56247a05f4e20c2df0de7d9abfebdf8 (plain)
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
33
34

#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#

--- nano-1.3.0/configure.ac~configure
+++ nano-1.3.0/configure.ac
@@ -39,16 +39,22 @@
 AC_HEADER_STDC
 AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h regex.h termio.h termios.h unistd.h)
 AC_CHECK_HEADER(regex.h,
-    AC_MSG_CHECKING([for broken regexec])
-    AC_TRY_RUN([
+AC_CACHE_CHECK([for broken regexec],
+        [nano_cv_func_regexec_segfault_emptystr],
+        AC_TRY_RUN([
 #include <sys/types.h>
 #include <regex.h>
 int main () { regex_t reg; size_t n = 1; regmatch_t r; regcomp(&reg, "\\<", 0); regexec(&reg, "", n, &r, 0); regfree(&reg); return 0; }],
-	AC_MSG_RESULT(no),
-	AC_MSG_RESULT(yes); AC_DEFINE(BROKEN_REGEXEC, 1, [Define this if your regexec() function segfaults when passed an empty string under certain conditions.])
+	nano_cv_func_regexec_segv_emptystr=no,
+	nano_cv_func_regexec_segv_emptystr=yes,
+	nano_cv_func_regexec_segv_emptystr=no)
     )
 )
 
+if test x$ac_cv_func_regexec_segv_emptystr = xyes; then
+	AC_DEFINE(BROKEN_REGEXEC, 1, [Define this if your regexec() function segfaults when passed an empty string under certain conditions.])
+fi
+
 dnl options
 AC_ARG_ENABLE(debug, 
 [  --enable-debug          Enable debugging (disabled by default)],