Fix IPC-Cmd test failure on Win32: check current directory as well
Steve Hay [Tue, 28 Nov 2006 16:43:17 +0000 (16:43 +0000)]
as those listed in $ENV{PATH} when searching for binaries

p4raw-id: //depot/perl@29410

lib/IPC/Cmd.pm

index c941c76..3e8e6d2 100644 (file)
@@ -13,7 +13,7 @@ BEGIN {
                         $USE_IPC_RUN $USE_IPC_OPEN3 $WARN
                     ];
 
-    $VERSION        = '0.36';
+    $VERSION        = '0.36_01';
     $VERBOSE        = 0;
     $DEBUG          = 0;
     $WARN           = 1;
@@ -186,7 +186,9 @@ sub can_run {
         return MM->maybe_command($command);
 
     } else {
-        for my $dir (split /\Q$Config::Config{path_sep}\E/, $ENV{PATH}) {
+        for my $dir ((split /\Q$Config::Config{path_sep}\E/, $ENV{PATH}),
+                     File::Spec->curdir()
+        ) {
             my $abs = File::Spec->catfile($dir, $command);
             return $abs if $abs = MM->maybe_command($abs);
         }