From: Zack Weinberg Date: Tue, 27 Jan 2026 21:00:08 +0000 (-0500) Subject: autoreconf: require word boundaries when grepping for macros (#111271) X-Git-Tag: v2.72.90~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=912567e9;p=thirdparty%2Fautoconf.git autoreconf: require word boundaries when grepping for macros (#111271) autoreconf’s first pass over configure.ac is effectively a grep operation for a number of macros that almost always appear directly in that file, if they’re going to appear at all. All but one of the regular expressions made no attempt to check for word boundaries, and the one that did was doing it incorrectly (using ^ rather than \b), leading to issue #111271. Fix all the regexps to surround each identifier with \b…\b and not to use ^. Reported by Kip, originally as gettext bug #52424. * bin/autoreconf.in (autoreconf_current_directory): In the first pass, require each of the macros we look for to be a complete word. --- diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 1dc38c840..4d08e5301 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -450,17 +450,17 @@ sub autoreconf_current_directory ($) while ($_ = $configure_ac_file->getline) { s/#.*//; - s/dnl.*//; - $uses_autoconf = 1 if /AC_INIT/; - $uses_liblink = 1 if /AC_LIB_HAVE_LINKFLAGS/; - $uses_liblink = 1 if /AC_LIB_LINKFLAGS/; - $uses_liblink = 1 if /AC_LIB_LINKFLAGS_FROM_LIBS/; - $uses_iconv = 1 if /AM_ICONV/; + s/\bdnl\b.*//; + $uses_autoconf = 1 if /\bAC_INIT\b/; + $uses_liblink = 1 if /\bAC_LIB_HAVE_LINKFLAGS\b/; + $uses_liblink = 1 if /\bAC_LIB_LINKFLAGS\b/; + $uses_liblink = 1 if /\bAC_LIB_LINKFLAGS_FROM_LIBS\b/; + $uses_iconv = 1 if /\bAM_ICONV\b/; # See below for why we look for gettext here. - $uses_gettext = 1 if /AM_GNU_GETTEXT/; - $uses_gettext = 1 if /AM_PO_SUBDIRS/; + $uses_gettext = 1 if /\bAM_GNU_GETTEXT\b/; + $uses_gettext = 1 if /\bAM_PO_SUBDIRS\b/; # Older autopoint versions fail if this macro is not present. - $uses_gettextversion = 1 if /^AM_GNU_GETTEXT_(?:REQUIRE_)?VERSION/; + $uses_gettextversion = 1 if /\bAM_GNU_GETTEXT_(?:REQUIRE_)?VERSION\b/; } if (!$uses_autoconf) {