From 18f8ae4bbed4d919e564fe54b94feb6bce2c4c8f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 19 Jan 2010 08:25:12 +0100 Subject: [PATCH] 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. --- m4/regex.m4 | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.11.0