(jm_INCLUDED_REGEX): Detect broken re_search in e.g. glibc-2.2.93.
authorJim Meyering <jim@meyering.net>
Sun, 2 Feb 2003 18:27:48 +0000 (18:27 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 2 Feb 2003 18:27:48 +0000 (18:27 +0000)
m4/regex.m4

index a31ef2c..3ba6166 100644 (file)
@@ -1,4 +1,4 @@
-#serial 14
+#serial 15
 
 dnl Initially derived from code in GNU grep.
 dnl Mostly written by Jim Meyering.
@@ -60,6 +60,16 @@ AC_DEFUN([jm_INCLUDED_REGEX],
            if (re_match (&regex, "an", 2, 0, &regs) != 2)
              exit (1);
 
+           memset (&regex, 0, sizeof (regex));
+           s = re_compile_pattern ("x", 1, &regex);
+           if (s)
+             exit (1);
+
+           /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
+              work with a negative RANGE argument.  */
+           if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+             exit (1);
+
            exit (0);
          }
        ],