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: Eric Blake
Subject: Re: Revenge of the $ECHO. Kill most uses of Xsed.
Date: Tue, 18 Nov 2008 22:12:27 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 11/17/2008 12:10 AM:
>>>      $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?  Ah, it should be a basename.  Well, our current
> basename functions don't compute the basename of files with backslash
> as directory separator.

On second thought, how do we compute basename?  On platforms like Linux,
it is legal to have \ in $0 (and thus $progname) that are not treated as
directory separators.  So this particular instance must indeed remain $ECHO.

>>> -                     RM="$ECHO $RM"
>>> +                     RM="echo $RM"
>> Are all of these safe, considering mingw might have \ in an absolute
>> pathname to these tools?
> 
> No, and I'm glad you ask about this.  The point here is that there is
> more than one argument following, and I didn't see an easy way to escape
> them properly, so I figured take the less likely of the bugs, as
> RM="$ECHO rm -f" is quite certain to do the wrong thing.  Suggestions?

Well, on mingw native, the default sh has an echo that doesn't eat \.  But
that doesn't help if you are doing a Solaris-mingw cross.  I'm also
stumped on thinking of any better alternative, though.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkjoDsACgkQ84KuGfSFAYA4mQCfd1cF7EWl5zRowXU4UMSKJycZ
4MEAnRFcZC9+Ev86Im9cNzGK0AvYXtVr
=59w4
-----END PGP SIGNATURE-----




reply via email to

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