Author: dagolden
Date: Mon Oct 26 20:35:05 2009
New Revision: 13433

Modified:
   Module-Build/trunk/t/lib/MBTest.pm

Log:
cope with absolute paths for tools in Config

Modified: Module-Build/trunk/t/lib/MBTest.pm
==============================================================================
--- Module-Build/trunk/t/lib/MBTest.pm  (original)
+++ Module-Build/trunk/t/lib/MBTest.pm  Mon Oct 26 20:35:05 2009
@@ -179,13 +179,20 @@
 
 sub find_in_path {
   my $thing = shift;
-  
-  my @path = split $Config{path_sep}, $ENV{PATH};
+
   my @exe_ext = exe_exts();
-  foreach (@path) {
-    my $fullpath = File::Spec->catfile($_, $thing);
+  if ( File::Spec->file_name_is_absolute( $thing ) ) {
     foreach my $ext ( '', @exe_ext ) {
-      return "$fullpath$ext" if -e "$fullpath$ext";
+      return "$thing$ext" if -e "$thing$ext";
+    }
+  }
+  else {
+    my @path = split $Config{path_sep}, $ENV{PATH};
+    foreach (@path) {
+      my $fullpath = File::Spec->catfile($_, $thing);
+      foreach my $ext ( '', @exe_ext ) {
+        return "$fullpath$ext" if -e "$fullpath$ext";
+      }
     }
   }
   return;

Reply via email to