I noticed that File::Spec::Win32->path does not work the same as the
internal utility function we usually use.  This is a patch that makes
it work the same.

   - "." is always searched first on Windows
   - empty paths are ignored
   - paths can be quoted
   - %ENV is caseless

--Gisle


--- lib/File/Spec/Win32.pm.orig 2005-09-17 08:59:45.000000000 +0200
+++ lib/File/Spec/Win32.pm      2005-09-17 09:02:32.000000000 +0200
@@ -108,9 +108,10 @@
 }
 
 sub path {
-    my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'};
-    my @path = split(';',$path);
-    foreach (@path) { $_ = '.' if $_ eq '' }
+    my @path = split(';', $ENV{PATH});
+    s/"//g for @path;
+    @path = grep length, @path;
+    unshift(@path, ".");
     return @path;
 }
 

Reply via email to