]> granicus.if.org Git - mutt/commitdiff
Add regfree to configure regex test.
authorKevin McCarthy <kevin@8t8.us>
Thu, 27 Sep 2018 22:03:40 +0000 (15:03 -0700)
committerKevin McCarthy <kevin@8t8.us>
Thu, 27 Sep 2018 22:03:40 +0000 (15:03 -0700)
This allows to run the system regex lib even when compiling with
ASAN.  Previously, ASAN would report the regex_t leak and change the
exit code.

configure.ac

index 28091866bb1f99dcc2c724f1a194710e4d13dec6..9fac116a042602114d953e691ac9944b4ba2fb85 100644 (file)
@@ -481,7 +481,20 @@ AC_CACHE_CHECK([whether your system's regexp library is completely broken],
         AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <unistd.h>
 #include <regex.h>
-main() { regex_t blah ; regmatch_t p; p.rm_eo = p.rm_eo; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); }]])],[mutt_cv_regex_broken=no],[mutt_cv_regex_broken=yes],[mutt_cv_regex_broken=yes]))
+int main() {
+  regex_t blah;
+  regmatch_t p;
+  p.rm_eo = p.rm_eo;
+  if (regcomp(&blah, "foo.*bar", REG_NOSUB) ||
+      regexec(&blah, "foobar", 0, NULL, 0))
+    return(1);
+  regfree(&blah);
+  return(0);
+}]])],
+                [mutt_cv_regex_broken=no],
+                [mutt_cv_regex_broken=yes],
+                [mutt_cv_regex_broken=yes]))
+
         if test $mutt_cv_regex_broken = yes ; then
                 echo "Using the included GNU regex instead." >&AS_MESSAGE_FD
                 mutt_cv_regex=yes