From: Jim Meyering Date: Tue, 19 Jan 2010 07:25:12 +0000 (+0100) Subject: ensure that the regexp [b-a] is diagnosed as invalid X-Git-Tag: v0.1~4641 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=18f8ae4bbed4d919e564fe54b94feb6bce2c4c8f;p=gnulib.git 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. --- diff --git a/m4/regex.m4 b/m4/regex.m4 index a70225247..6bd6b8f7d 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -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 (®ex, 0, sizeof regex); + s = re_compile_pattern ("a[b-a]", 6, ®ex); + if (s == 0) + return 1; + /* This should succeed, but does not for glibc-2.1.3. */ memset (®ex, 0, sizeof regex); s = re_compile_pattern ("{1", 2, ®ex);