ensure that the regexp [b-a] is diagnosed as invalid
authorJim Meyering <meyering@redhat.com>
Tue, 19 Jan 2010 07:25:12 +0000 (08:25 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 3 Feb 2010 15:11:22 +0000 (16:11 +0100)
* m4/regex.m4 (gl_REGEX): Ensure that re_compiler_pattern
diagnoses [b-a] as invalid when using RE_SYNTAX_POSIX_EGREP.
Currently, glibc-2.11.90-10 fails to do that.

m4/regex.m4

index a702252..6bd6b8f 100644 (file)
@@ -96,6 +96,13 @@ AC_DEFUN([gl_REGEX],
             if (!s)
               return 1;
 
+            /* Ensure that [b-a] is diagnosed as invalid. */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("a[b-a]", 6, &regex);
+            if (s == 0)
+              return 1;
+
             /* This should succeed, but does not for glibc-2.1.3.  */
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("{1", 2, &regex);