]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
m4sugar: fix AS_VAR_GET regression.
authorGary V. Vaughan <gary@gnu.org>
Tue, 29 Jan 2013 12:17:04 +0000 (19:17 +0700)
committerGary V. Vaughan <gary@gnu.org>
Tue, 29 Jan 2013 12:25:14 +0000 (19:25 +0700)
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.

NEWS
doc/autoconf.texi
lib/m4sugar/m4sh.m4

diff --git a/NEWS b/NEWS
index 35e7b88b631928895b7fa87a86c1696714ba119b..16de9224ba3418d0f8ced6e567a52670b91867f7 100644 (file)
--- a/NEWS
+++ b/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
 
index c95d871c257f4e1eedb6427f6e1f3240421b10ef..8f58d4a3473c1565b22edeb0872c2c61bfda6b57 100644 (file)
@@ -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}.
 
index 479c2d91ea330177c484617b5d2202acfb43930a..53fdf8db4a293b9b4d0698ed09d02ac9c05d3259 100644 (file)
@@ -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)