diff options
author | Jim Meyering <jim@meyering.net> | 2003-01-29 20:20:36 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-01-29 20:20:36 +0000 |
commit | a3d30ef9516ed8afd73067030540ea55604fcaff (patch) | |
tree | 974729e6b2c36917f85d1db3828441f00f655330 | |
parent | 1c5a98512f19aa5b167b7417e5ba42f1bc032ee1 (diff) | |
download | coreutils-a3d30ef9516ed8afd73067030540ea55604fcaff.tar.xz |
Detect broken re_search in e.g. glibc-2.2.93.
-rw-r--r-- | m4/regex.m4 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/m4/regex.m4 b/m4/regex.m4 index 3e9f866e6..acfdf9431 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,4 +1,4 @@ -#serial 13 +#serial 14 dnl Initially derived from code in GNU grep. dnl Mostly written by Jim Meyering. @@ -55,6 +55,16 @@ AC_DEFUN([jm_INCLUDED_REGEX], if (re_match (®ex, "an", 2, 0, ®s) != 2) exit (1); + memset (®ex, 0, sizeof (regex)); + s = re_compile_pattern ("x", 1, ®ex); + if (s) + exit (1); + + /* The version of regex.c in e.g. GNU libc-2.2.93 didn't + work with a negative `range' argument. */ + if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1) + exit (1); + exit (0); } ], |