look for .bat and .cmd files when probing for executables on MSWIN32
authorTony Cook <tony@develop=help.com>
Mon, 31 Aug 2009 11:56:18 +0000 (11:56 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 31 Aug 2009 11:56:18 +0000 (11:56 +0000)
Makefile.PL

index f13b7e1636f0158a589e29a61452d0f3d30f1072..ce37cf0f38eef084aadc914d4981454ccf38cf55 100644 (file)
@@ -870,9 +870,16 @@ sub catfile {
 sub is_exe {
   my ($name) = @_;
 
+  my @exe_suffix = $Config{_exe};
+  if ($^O eq 'MSWin32') {
+    push @exe_suffix, qw/.bat .cmd/;
+  }
+
   for my $dir (File::Spec->path) {
-    -x catfile($dir, "$name$Config{_exe}")
-      and return 1;
+    for my $suffix (@exe_suffix) {
+      -x catfile($dir, "$name$suffix")
+       and return 1;
+    }
   }
 
   return;