Subject: | Fails to find EXEs on cygwin |
This is sort of related to #49908.
In some cases, EXEs installed via Windows (e.g. java.exe) are not found using `which`. This
occurs when the EXE does not have the execute bit set when listed (`ls -l`) via a cygwin shell.
However, those EXEs are still executable and run OK.
I've attached a patch that seems to work for me. Please consider applying it.
Thanks,
-- Mithun
Subject: | 49908.patch |
--- Which.pm 2013-02-02 22:04:00.000000000 -0600
+++ Which.pm.orig 2013-02-02 21:48:26.000000000 -0600
@@ -16,7 +16,6 @@
use constant IS_VMS => ($^O eq 'VMS');
use constant IS_MAC => ($^O eq 'MacOS');
use constant IS_DOS => ($^O eq 'MSWin32' or $^O eq 'dos' or $^O eq 'os2');
-use constant IS_CYG => ($^O eq 'cygwin');
# For Win32 systems, stores the extensions used for
# executable files
@@ -33,11 +32,6 @@
}
} elsif ( IS_VMS ) {
push @PATHEXT, qw{.exe .com};
-} elsif ( IS_CYG ) {
-
- # See this for more info
- # http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-exe
- push @PATHEXT, qw{.exe};
}
sub which {
@@ -95,7 +89,7 @@
IS_MAC
||
(
- ( IS_DOS or IS_CYG )
+ IS_DOS
and
grep {
$file =~ /$_\z/i