This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: bug in texi2dvi, and hack patch

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   
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Thunderbird -


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]