autoconf-patches
[Top][All Lists]
Advanced

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

Re: 15autotest-more-info-prettier.diff


From: gary
Subject: Re: 15autotest-more-info-prettier.diff
Date: Fri, 15 Aug 2003 14:37:35 +0100
User-agent: Demon-WebMail/2.0

Salut Akim.

Argh!  What a mess :-(

Okay, I'm convinced that this need's fixing in m4.  I am more or less happy 
with the module API now, and very close to releasing 2.0, but I am on holiday 
next week so won't get much more done after the weekend.

address@hidden wrote:
> 
>  > address@hidden wrote:
>  >> +    $at_quiet $ECHO_N "m4_format([[%3d: %-45s]],
>  >> +                AT_ordinal, [$1])[]$ECHO_C"
> 
>  > The above line is overquoted, and should read:
> 
>  >   +                    AT_ordinal, $1)[]$ECHO_C"
> 
>  > Consider:  I want to create a test group called `divert'.
> 
> This overquotation is a workaround m4 being underquoting in its text
> processing builtins.  Because of this, if you don't double quote the
> format string, you get an underquoted result.  Your solution is even
> more severely underquoted, since $1 will be evaluated before being
> passed to m4_format.  Just imagine that I pass "dnl", or "hello,
> world" (yep, with a comma), or "#foo", or ") he he", or "] ha ha", and
> imagine the result (and the bug reports about Autotest).

This is the same problem you are having with patsubst and regex right? I'm not 
sure that I understand the criterion for determining whether a builtin is 
underquoting.  Are you saying that the argument collecter needs to be more 
careful with quotes, or that the internals of some builtins should add quotes 
before they shipout their results?  Have you got a recipe for identifying 
builtins that need attention?  I'd like to write some new tests, and then fix 
this once and for all.

Part of my problem is that m4 is under-specified, and there is a lot of room 
for interpretation in the loose specs I have found :-(


> m4_changequote(<<, >>)
> m4_define(<<m4_split>>,
> <<m4_changequote(``, '')dnl
> [dnl Can't use m4_default here instead of m4_if, because m4_default uses
> dnl [ and ] as quotes.
> m4_bpatsubst(````$1'''',
>            m4_if(``$2'',, ``[  ]+'', ``$2''),
>            ``], ['')]dnl
> m4_changequote([, ])>>)
> m4_changequote([, ])

Ick!  m4 is NOT supposed to be such hard work.  Sorry I didn't cotton on to 
this sooner :-(

Cheers,
        Gary.





reply via email to

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