changeset 12846:47a829b330dc

ensure that the regexp [b-a] is diagnosed as invalid * 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.
author Jim Meyering <meyering@redhat.com>
date Tue, 19 Jan 2010 08:25:12 +0100
parents ad16dedc2e1d
children 64dad3a0ba71
files m4/regex.m4
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -96,6 +96,13 @@
             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);