Mail Archives: cygwin/2005/05/24/08:33:19
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Stepan Kasal on 5/24/2005 6:22 AM:
> So my job was to fix the comment. Well, I actually replaced the code
> together with the comments, to get something which is easier to explain.
> (Actually, my code is close to what Autoconf does.)
>
> See the attached patch.
> I hope I haven't screwed anything.
>
> Have a nice day,
> Stepan Kasal
>
> PS: if ebb9 or dave can actually fwd this to the cygwin list, that might be
> a good idea; I'm not subscribed there.
Cygwin is an open list, so your comment already made it there.
> @@ -130,16 +130,15 @@
> saveIFS=$IFS
> IFS=$path_sep # break path components at the path separator
> for dir in $PATH; do
> + # The basic test for an executable is `test -f $f && test -x $f'.
> + # `test -x' is not enough, because it can also be true for directories.
> + #
> + # On Cygwin and DJGPP, `test -x' also looks for .exe. On Cygwin, also
> + # `test -f' has this enhancement, bot not on DJGPP. (Both are design
> + # decisions, so there is little chance to make them consistent.)
> + # Thus we have to try `test -f' twice.
> + if test -x "$dir/$1" &&
> + { test -f "$dir/$1" || test -f "$dir/$1.exe"; }; then
Not quite. Now, if both tex and tex.exe exist, but tex is not executable,
then you just failed to find tex.exe on cygwin. If you are going to use
test -f on both tex and tex.exe, then you also need to do so with test -x:
if { test -x "$dir/$1" || test -x "$dir/$1.exe"; } &&
{ test -f "$dir/$1" || test -f "$dir/$1.exe"; }; then
And even that is not quite right - suppose tex is a directory, so just
test -x passes, and tex.exe is a non-executable file, so just test -f
passes. Maybe something more like this is needed:
if { test -x "$dir/$1" && test -f "$dir/$1"; } ||
{ test -x "$dir/$1.exe" && test -f "$dir/$1.exe"; }; then
- --
Life is short - so eat dessert first!
Eric Blake ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCkx7684KuGfSFAYARAqz/AJwLx4nwhDPKVEuP3m0pf+QXgGGjqQCfaf4k
rp4jmGPs+9j50+V5ol24aJQ=
=teko
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -