]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
m4/m4.m4: Quote argument to AS_ECHO correctly.
authorKO Myung-Hun <komh78@gmail.com>
Wed, 18 Oct 2023 18:00:11 +0000 (14:00 -0400)
committerZack Weinberg <zack@owlfolio.org>
Wed, 18 Oct 2023 18:00:11 +0000 (14:00 -0400)
AS_ECHO’s argument is required to be “a single shell word,”
and this more precisely means it must not be altered by shell
word splitting.  In particular, if the argument contains shell
variables whose values contain whitespace then it needs to be
wrapped in "shell double quotes".

The absence of these quotes caused one of the embedded M4 scripts
to be mangled by the Autoconf 2.69 implementation of AS_ECHO.
We don’t officially support bootstrapping with an older version
of Autoconf (use the ./bootstrap script instead) but the absence
of quotes is still incorrect.

For consistency add [M4 quotes] to the use of AS_ECHO that was
shell-quoted but not M4-quoted.

* m4/m4.m4 (AC_PROG_GNU_M4): Quote argument to AS_ECHO correctly.

m4/m4.m4

index e6203118568baa5871f7d36fccae2a63917d156c..919dbf4a737eb587b7ecd502557aaacfb2f12565 100644 (file)
--- a/m4/m4.m4
+++ b/m4/m4.m4
@@ -41,12 +41,12 @@ AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4 gnum4],
       ac_snip2=change'quote(<,>)def''ine(<T>,<>)d'nl
       ac_snip2=${ac_snip2}${as_nl}def'ine(<F>,<T(<traced>)>)d'nl
       ac_snip2=${ac_snip2}${as_nl}m4'wrap(<F>)d'nl
-      AS_ECHO("$as_me:${as_lineno-$LINENO}: trying $ac_path_M4") \
+      AS_ECHO(["$as_me:${as_lineno-$LINENO}: trying $ac_path_M4"]) \
           >&AS_MESSAGE_LOG_FD
       test -z "`$ac_path_M4 -F conftest.m4f </dev/null 2>&1`" \
-      && test -z "`AS_ECHO([$ac_snippet]) | $ac_path_M4 --trace=mac 2>&1`" \
+      && test -z "`AS_ECHO(["$ac_snippet"]) | $ac_path_M4 --trace=mac 2>&1`" \
       && test -f conftest.m4f \
-      && test x"`AS_ECHO([$ac_snip2]) | \
+      && test x"`AS_ECHO(["$ac_snip2"]) | \
                 $ac_path_M4 --trace=T --debug=aflq 2>&1`" = \
               x'm4trace:stdin:3: -1- T(<traced>)' \
       && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=: