autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHv3] m4sugar: factor away _AS_ECHO_PREPARE.


From: Stefano Lattarini
Subject: Re: [PATCHv3] m4sugar: factor away _AS_ECHO_PREPARE.
Date: Tue, 29 Jan 2013 22:17:38 +0100

On 01/29/2013 08:05 PM, Nick Bowler wrote:
> 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).
>
I stand corrected then.  Good, one less enhancement to worry about :-)

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

Thanks,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]