Expect rpmatch to be declared.
[gnulib.git] / m4 / memmem.m4
index 4deca48..383ed4b 100644 (file)
@@ -1,4 +1,4 @@
-# memmem.m4 serial 8
+# memmem.m4 serial 10
 dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -26,11 +26,11 @@ AC_DEFUN([gl_FUNC_MEMMEM],
   if test $ac_cv_have_decl_memmem = yes; then
     AC_CACHE_CHECK([whether memmem works in linear time],
       [gl_cv_func_memmem_works],
-      [AC_RUN_IFELSE([AC_LANG_PROGRAM([
+      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <string.h> /* for memmem */
 #include <stdlib.h> /* for malloc */
 #include <unistd.h> /* for alarm */
-], [[size_t m = 1000000;
+]], [[size_t m = 1000000;
     char *haystack = (char *) malloc (2 * m + 1);
     char *needle = (char *) malloc (m + 1);
     void *result = 0;
@@ -51,8 +51,8 @@ AC_DEFUN([gl_FUNC_MEMMEM],
        [gl_cv_func_memmem_works=yes], [gl_cv_func_memmem_works=no],
        [dnl pessimistically assume the worst, since even glibc 2.6.1
         dnl has quadratic complexity in its memmem
-        gl_cv_func_memmem_works=no])])
-    if test $gl_cv_func_memmem_works = no; then
+        gl_cv_func_memmem_works="guessing no"])])
+    if test "$gl_cv_func_memmem_works" != yes; then
       REPLACE_MEMMEM=1
       AC_LIBOBJ([memmem])
     fi