summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-04-10 06:46:07 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-04-10 06:46:07 +0000
commit72021730a8e675b697b008c45248fc65af05dfaf (patch)
tree415920e9c939cab7fd777f59f59576a2bb8818d6 /m4
parent1fe38016fa8b37a6519294dcb9cccda9065d3095 (diff)
downloadcoreutils-72021730a8e675b697b008c45248fc65af05dfaf.tar.xz
Import latest regex module from gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/ChangeLog5
-rw-r--r--m4/regex.m48
2 files changed, 12 insertions, 1 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
index e65971bc7..31d3999ed 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-09 Paul Eggert <eggert@cs.ucla.edu>
+
+ * regex.m4 (gl_REGEX): Check for new glibc interface to
+ translation table.
+
2006-03-11 Eric Blake <ebb9@byu.net>
* double-slash-root.m4: New file, provides gl_DOUBLE_SLASH_ROOT.
diff --git a/m4/regex.m4 b/m4/regex.m4
index c6490d227..c60085250 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,4 +1,4 @@
-#serial 35
+#serial 36
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006 Free Software Foundation, Inc.
@@ -38,13 +38,19 @@ AC_DEFUN([gl_REGEX],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT
+ #include <limits.h>
#include <regex.h>
],
[[static struct re_pattern_buffer regex;
+ unsigned char folded_chars[UCHAR_MAX + 1];
+ int i;
const char *s;
struct re_registers regs;
re_set_syntax (RE_SYNTAX_POSIX_EGREP);
memset (&regex, 0, sizeof (regex));
+ for (i = 0; i <= UCHAR_MAX; i++)
+ folded_chars[i] = i;
+ regex.translate = folded_chars;
s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
/* This should fail with _Invalid character class name_ error. */
if (!s)