]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Avoid \] in BREs and EREs
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Jun 2022 22:26:07 +0000 (17:26 -0500)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Jun 2022 23:27:40 +0000 (18:27 -0500)
* bootstrap (PACKAGE_NAME, PACKAGE_BUGREPORT):
* lib/autoconf/status.m4 (AC_OUTPUT_MAKE_DEFS):
* maint.mk (longopt_re, gpg_key_ID):
* tests/m4sugar.at (m4_dumpdef):
Avoid \] in POSIX-specified regular expressions, as POSIX says \]
produces undefined results in BREs and EREs.

bootstrap
lib/autoconf/status.m4
maint.mk
tests/m4sugar.at

index 16c758de2b9317523e5dff297b43486ef21ddcef..c6139547c479e3740af076d3b5d8600adf272212 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -149,9 +149,9 @@ VERSION=$(build-aux/git-version-gen .tarball-version)
 # get copied into the generated configure script, so we need to get them
 # right.  Caution: there is a hard tab in one of the regexes below.
 PACKAGE_NAME=$(sed -n < configure.ac \
-   -e 's/^m4_define(\[autoconf_PACKAGE_NAME\], \[\([^]]*\)\])$/\1/p')
+   -e 's/^m4_define(\[autoconf_PACKAGE_NAME], \[\([^]]*\)])$/\1/p')
 PACKAGE_BUGREPORT=$(sed -n < configure.ac \
-   -e 's/^m4_define(\[autoconf_PACKAGE_BUGREPORT\], \[\([^]]*\)\])$/\1/p')
+   -e 's/^m4_define(\[autoconf_PACKAGE_BUGREPORT], \[\([^]]*\)])$/\1/p')
 
 if [ -z "$RELEASE_YEAR" ]; then
     echo "$me: error: could not extract RELEASE_YEAR from configure.ac" >&2
index 8705b9580d41819f3829c4b6635fd3373b9e8334..55f2d9e921fc2e417abcf4051acf9651feaa109d 100644 (file)
@@ -1772,9 +1772,7 @@ s/^[       ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
 t quote
 b any
 :quote
-s/[     `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
+s/[][   `~#$^&*(){}\\|;'\''"<>?]/\\&/g
 s/\$/$$/g
 H
 :any
index 1c8c5b300306bf61e27bc20564dcb59a063a2031..8cfcca1405b1c31c66430013dc1ce80c6e272208 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -826,7 +826,7 @@ sc_trailing_blank:
 # Match lines like the following, but where there is only one space
 # between the options and the description:
 #   -D, --all-repeated[=delimit-method]  print all duplicate lines\n
-longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
+longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*]?)?
 sc_two_space_separator_in_usage:
        @prohibit='^   *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$'         \
        halt='help2man requires at least two spaces between an option and its description'\
@@ -1393,7 +1393,7 @@ gpg_key_ID ?=                                                             \
   $$(cd $(srcdir)                                                      \
      && git cat-file tag v$(VERSION)                                   \
         | $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null    \
-        | $(AWK) '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
+        | $(AWK) '/^\[GNUPG:] ERRSIG / {print $$3; exit}')
 
 translation_project_ ?= coordinator@translationproject.org
 
index dec8c06d22d01a961cc7096c8ecf031e12291f8d..a13483c065473992bcb7faa3b109e9ba25230e74 100644 (file)
@@ -196,7 +196,7 @@ m4_dumpdef([good], [oops])
 ]])
 
 AT_CHECK_M4SUGAR([-o-], 1, [], [stderr])
-AT_CHECK([grep '^good: \[[yep\]]$' stderr], [0], [ignore])
+AT_CHECK([grep '^good: \[[yep]]$' stderr], [0], [ignore])
 AT_CHECK([grep 'm4@&t@_dumpdef: undefined.*oops' stderr], [0], [ignore])
 
 # Check that pushdef stacks can be dumped.