From f9d2fe251f3a104df656ab6ffc64821893ab9003 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 10 Mar 2012 12:15:44 -0800 Subject: [PATCH] regex: allow inclusion of before Without this patch, portable programs had to include before if they wanted a consistent value for RE_DUP_MAX. I ran into this problem with a test version of GNU grep on Solaris 8. * lib/regex.h: Include if _REGEX_INCLUDE_LIMITS_H. This is done conditionally so that this change can be merged back to glibc. * m4/regex.m4 (gl_REGEX): Define _REGEX_INCLUDE_LIMITS_H if using the included regex. --- ChangeLog | 10 ++++++++++ lib/regex.h | 3 +++ m4/regex.m4 | 5 ++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c000eced4..ab2d85c79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2012-03-10 Paul Eggert + regex: allow inclusion of before + Without this patch, portable programs had to include before + if they wanted a consistent value for RE_DUP_MAX. + I ran into this problem with a test version of GNU grep on Solaris 8. + * lib/regex.h: Include if _REGEX_INCLUDE_LIMITS_H. + This is done conditionally so that this change can be merged + back to glibc. + * m4/regex.m4 (gl_REGEX): Define _REGEX_INCLUDE_LIMITS_H if + using the included regex. + fts: depend on fdopendir * modules/fts (Depends-on): Depend on fdopendir. This is needed on Solaris 8, at least, since it lacks fdopendir. Evidently the diff --git a/lib/regex.h b/lib/regex.h index 7399cb7de..0c3b420d7 100644 --- a/lib/regex.h +++ b/lib/regex.h @@ -294,6 +294,9 @@ extern reg_syntax_t re_syntax_options; /* Maximum number of duplicates an interval can allow. POSIX-conforming systems might define this in , but we want our value, so remove any previous define. */ +# ifdef _REGEX_INCLUDE_LIMITS_H +# include +# endif # ifdef RE_DUP_MAX # undef RE_DUP_MAX # endif diff --git a/m4/regex.m4 b/m4/regex.m4 index 08f1352e2..41be5e8d3 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,4 +1,4 @@ -# serial 60 +# serial 61 # Copyright (C) 1996-2001, 2003-2012 Free Software Foundation, Inc. # @@ -175,6 +175,9 @@ AC_DEFUN([gl_REGEX], esac if test $ac_use_included_regex = yes; then + AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1], + [Define if you want to include , so that it + consistently overrides 's RE_DUP_MAX.]) AC_DEFINE([_REGEX_LARGE_OFFSETS], [1], [Define if you want regoff_t to be at least as wide POSIX requires.]) AC_DEFINE([re_syntax_options], [rpl_re_syntax_options], -- 2.11.0