2005-05-24 Stepan Kasal * util/texi2dvi (findprog): Rewrite the test for an executable and the explanation above. Index: util/texi2dvi =================================================================== RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v retrieving revision 1.50 diff -u -r1.50 texi2dvi --- util/texi2dvi 15 May 2005 00:00:08 -0000 1.50 +++ util/texi2dvi 24 May 2005 12:17:53 -0000 @@ -130,16 +130,15 @@ saveIFS=$IFS IFS=$path_sep # break path components at the path separator for dir in $PATH; do - # use test -x rather than test -f for DJGPP, where test -x checks - # for .exe. But test -x will also return true for directories, so - # explicitly ignore those. - if test -x "$dir/$1" && test ! -d "$dir/$1"; then - foundprog=true - break - - # But on cygwin, test -x foo will not find foo.exe. So also check - # for that. - elif test -x "$dir/$1.exe"; then + # 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 foundprog=true break fi