Re: [PATCHv3] m4sugar: factor away _AS_ECHO_PREPARE.

Nick Bowler <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Organization Elliptic Technologies Inc.
Message-ID <[email protected]>
On 2013-01-29 19:26 +0100, Stefano Lattarini wrote:
> On 01/29/2013 07:17 AM, Gary V. Vaughan wrote:
[...]
> >  # Find who we are.  Look in the path if we contain no directory separator.
> > @@ -1023,63 +1025,15 @@ fi
> >  # Output WORD followed by a newline.  WORD must be a single shell word
> >  # (typically a quoted string).  The bytes of WORD are output as-is, even
> >  # if it starts with "-" or contains "\".
> > -m4_defun_init([AS_ECHO],
> > -[AS_REQUIRE([_$0_PREPARE])],
> > -[$as_echo $1])
> > +m4_defun([AS_ECHO],
> > +[printf '%s\n' $1])
> >  
> This won't work as expected with some invocation like:
> 
>   AS_ECHO([1 2 3])
> 
> as the generated code will print:
> 
>   1
>   2
>   3
> 
> rather than the (IMHO) expected:
> 
>   1 2 3
> 
> This is *not* a regression, since this issue was already in the
> existing code; but it would be nice to have it fixed in a follow-up
> patch.

FYI, the Autoconf manual[1] explicitly says that such usage is not
allowed:

  Macro: AS_ECHO (word)
  ...
  word must be a single shell word (typically a quoted string).

[1] https://gnu.org/software/autoconf/manual/autoconf.html#index-AS_005fECHO-1564

Cheers,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.