libtool-patches
[Top][All Lists]
Advanced

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

Re: Revenge of the $ECHO. Kill most uses of Xsed.


From: Paolo Bonzini
Subject: Re: Revenge of the $ECHO. Kill most uses of Xsed.
Date: Mon, 17 Nov 2008 09:21:34 +0100
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

>>      $ECHO "run \`$progname --help | more' for full usage"
> 
> This can be echo rather than $ECHO, since the \` is flattened during ""
> interpratation prior to the echo call.  Several similar places exist.

What about $progname?  I think $ECHO->echo is almost always a bad idea
whenever there is a $ inside... (almost, of course)

>> -    $ECHO "host: $host"
>> +    echo "host: $host"
> 
> Are we guaranteed that $host never contains \?

Most likely yes.

>> -    $ECHO "export $shlibpath_var"
>> +    echo "export $shlibpath_var"
> 
> Likewise, for shlibpath_var.

Most likely no. :-)  (Think mingw).

>> -      $ECHO >> "$output_objdir/$my_dlsyms" "\
>> +      echo >> "$output_objdir/$my_dlsyms" "\
> 
> This lacks context to see if it is safe, or if the text being appended
> contains \.  Several instance of this idiom.

Indeed.

>>              $ECHO "*** because the file extensions .$libext of this 
>> argument makes me believe"
>> -            $ECHO "*** that it is just a static archive that I should not 
>> use here."
>> +            echo "*** that it is just a static archive that I should not 
>> use here."
> 
> Is $libext ever likely to contain \, or can we use plain echo here, too?

libext should be safe.

> Does $teststring contain \, or can we use echo here to avoid forks in this
> loop on shells where $ECHO is expensive?

No it doesn't.  But it wanted to measure the actual length of the
commandline you can pass to ECHO.

> Most of the patch looked okay to me (rather mechanical), so hopefully I
> didn't let my eyes glaze over and miss an obvious typo.

I'll look for more.

Paolo




reply via email to

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