From: Paul Eggert Date: Wed, 10 Sep 2025 15:33:49 +0000 (-0700) Subject: regex: fix support for overriding "gnulib" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4cdb40ad1254b834d69a76c4e2a393ea09cf45c;p=thirdparty%2Fgnulib.git regex: fix support for overriding "gnulib" Problem reported by Pádraig Brady in: https://lists.gnu.org/r/bug-gnulib/2025-09/msg00104.html * lib/regex_internal.h [!_LIBC]: Simplify by including gettext.h rather than doing things by hand and mishandling GNULIB_TEXT_DOMAIN. (gettext_noop) [!_LIBC]: Remove, since gettext.h does that now. * modules/regex (Depends-on): Add gettext-h. --- diff --git a/ChangeLog b/ChangeLog index fd6965d404..8b83dca9f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2025-09-10 Paul Eggert + + regex: fix support for overriding "gnulib" + Problem reported by Pádraig Brady in: + https://lists.gnu.org/r/bug-gnulib/2025-09/msg00104.html + * lib/regex_internal.h [!_LIBC]: Simplify by including gettext.h + rather than doing things by hand and mishandling GNULIB_TEXT_DOMAIN. + (gettext_noop) [!_LIBC]: Remove, since gettext.h does that now. + * modules/regex (Depends-on): Add gettext-h. + 2025-09-09 Pádraig Brady maintainer-makefile: relax coverage requirements diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 855025e13b..03893b8630 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -98,24 +98,14 @@ #endif /* This is for other GNU distributions with internationalized messages. */ -#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC +#ifdef _LIBC # include # undef gettext -# ifdef _LIBC -# define gettext(msgid) \ +# define gettext(msgid) \ __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES) -# else -# define gettext(msgid) dgettext (GNULIB_TEXT_DOMAIN, msgid) -# endif -#else -# undef gettext -# define gettext(msgid) (msgid) -#endif - -#ifndef gettext_noop -/* This define is so xgettext can find the internationalizable - strings. */ # define gettext_noop(String) String +#else +# include "gettext.h" #endif /* Number of ASCII characters. */ diff --git a/modules/regex b/modules/regex index 34802a4a94..75e897edde 100644 --- a/modules/regex +++ b/modules/regex @@ -22,6 +22,7 @@ vararrays attribute [test $ac_use_included_regex = yes] btowc [test $ac_use_included_regex = yes] builtin-expect [test $ac_use_included_regex = yes] +gettext-h [test $ac_use_included_regex = yes] glibc-internal/dynarray [test $ac_use_included_regex = yes] gnulib-i18n [test $ac_use_included_regex = yes] intprops [test $ac_use_included_regex = yes]