mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-11 13:51:04 +08:00
m4sugar: fix AS_VAR_GET regression.
AS_VAR_GET expands AS_ECHO inside en evaled single quoted string, which causes the single quotes in "printf '%s\n'" to expose the %s\n to the shell which expands "\n" to simply "n" before passing it to printf. * lib/m4sugar/m4sh.m4 (AS_ECHO): Use double quotes around the format string. * doc/autoconf.texi (Limitations of Shell Builtins): Show double quotes to match AS_ECHO expansion. * NEWS: Likewise.
This commit is contained in:
parent
2b59b6f8a7
commit
c3d301efd6
2
NEWS
2
NEWS
@ -10,7 +10,7 @@ GNU Autoconf NEWS - User visible changes.
|
||||
|
||||
** Use of printf is now recommended instead of working around bugs in
|
||||
echo. Macros AS_ECHO and AS_ECHO_N now expand unconditionally to
|
||||
"printf '%s\n'" and "printf %s".
|
||||
'printf "%s\n"' and 'printf %s'.
|
||||
|
||||
** Macros
|
||||
|
||||
|
@ -17523,7 +17523,7 @@ only if you know that @var{foo}'s value cannot contain backslashes and
|
||||
cannot start with @samp{-}.
|
||||
|
||||
Normally, @command{printf} is safer and easier to use than @command{echo}
|
||||
and @command{echo -n}. Thus, you should use @command{printf '%s\n'}
|
||||
and @command{echo -n}. Thus, you should use @command{printf "%s\n"}
|
||||
instead of @command{echo}, and similarly use @command{printf %s} instead
|
||||
of @command{echo -n}.
|
||||
|
||||
|
@ -1026,7 +1026,7 @@ fi
|
||||
# (typically a quoted string). The bytes of WORD are output as-is, even
|
||||
# if it starts with "-" or contains "\".
|
||||
m4_defun([AS_ECHO],
|
||||
[printf '%s\n' $1])
|
||||
[printf "%s\n" $1])
|
||||
|
||||
|
||||
# AS_ECHO_N(WORD)
|
||||
|
Loading…
Reference in New Issue
Block a user