[Top][All Lists]

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

Re: libtool 2.4 args parsing incredibly slow

From: Ralf Wildenhues
Subject: Re: libtool 2.4 args parsing incredibly slow
Date: Thu, 27 Jan 2011 10:14:36 +0100

Hello Ingo,

* Ingo Krabbe wrote on Thu, Jan 27, 2011 at 08:52:51AM CET:
> Whats about the quite simple solution using sed?  Actually the sed call
> should be faster for many arguments and is reasonable fast for short
> command lines.

$(cmd) command substitution is not portable.
printf is not portably bug-free to handle long inputs.
Portable sed cannot handle long input lines.
This is all documented in the Shell Portability chapter
of the Autoconf manual.

> func_exec_program ()
> {
>   func_exec_program_core $(printf "\"%s\" " "$@" | sed \
>       -e 's/"--lt-[^"]*"[ \t]*//g' \
>       -e 's/^"\([^"]*\)"/\1/g' \
>       -e 's/[ \t]*"\([^"]*\)"/ \1/g'
>       )
> }

Your code mishandles arguments like 'X"--lt-foo"bar',
and, more generally, arguments that contain double quotes.


reply via email to

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