+2018-12-15 Jim Meyering <meyering@fb.com>
+
+ regex: work around a bug in glibc-2.27 and prior
+ * m4/regex.m4 (gl_REGEX): Reject any system regexp that gets a failed
+ assertion for /0|()0|\1|0/.
+ * tests/test-regex.c (main): Add the same test here.
+
2018-12-15 Bruno Haible <bruno@clisp.org>
localename: Fix use of uninitialized shell variable.
-# serial 67
+# serial 68
# Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
#
if (! REG_STARTEND)
result |= 64;
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (®ex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\1|0", 10, ®ex);
+ if (!s || strcmp (s, "Invalid back reference"))
+ result |= 64;
+
#if 0
/* It would be nice to reject hosts whose regoff_t values are too
narrow (including glibc on hosts with 64-bit ptrdiff_t and
if (! REG_STARTEND)
result |= 64;
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (®ex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\1|0", 10, ®ex);
+ if (!s || strcmp (s, "Invalid back reference"))
+ result |= 64;
+
#if 0
/* It would be nice to reject hosts whose regoff_t values are too
narrow (including glibc on hosts with 64-bit ptrdiff_t and