[Top][All Lists]

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

Re: Patch: Too many files in AC_OUTPUT cause M4 error

From: Martin Frydl
Subject: Re: Patch: Too many files in AC_OUTPUT cause M4 error
Date: Wed, 27 Nov 2002 18:36:03 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

Alexandre Duret-Lutz wrote:
[M-F-T: address@hidden

"Martin" == Martin Frydl <address@hidden> writes:


 Martin> I've created a patch which is aware of M4 problem and
 Martin> separates the task into two expressions - first removes the
 Martin> terminating space, then strips the leading one and puts brackets
 Martin> around.


 Martin> +  [at_patsubst(at_patsubst(at_patsubst(at_patsubst([[[[$1]]]], 
 Martin> +                                       [[\n\t ]+], [ ]),
 Martin> +                           [ *\(.\)$],[\1]),
 Martin> +               [^ *\(.*\)], [[\1]])])

This doesn't seem to do what you want.  `[ *\(.\)$],[\1]' will leave the
last trailing space, or strip non trailing whitespaces.

How about something like

[at_patsubst(at_patsubst(at_patsubst(at_patsubst([[[[$1]]]], [\\\n]),
                                     [[\n\t ]+], [ ]),
                         [ *$]),
             [^ *\(.*\)], [[\1]])])

Unfortunatelly, you are not right here. The problem is that second at_patsubst (the one stripping the terminating space) receives argument wrapped in brackets: `[ xxx ]' (note four brackets around $1). My version copies `]' to output while your one fails (does not strip anything). I was not able to put `]' to patterns so I used `.' here.

I've created a simple test showing these macros in action. The attached script contains simplified tracefile coming from autoconf with three at_flatten versions - original, mine and yours. If you run the script, it will show the results in all three versions (adds `<<' to the end of line so you can see if space is present or not). Note that original version also remains space in place. This is because `.*' is greedy and consumes also all spaces at the end of string so there will remain none to match with following ` *'.


Description: Bourne shell script

reply via email to

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