Subject: Improved File::Spec::Win32->path [PATCH]
From: Gisle Aas <gisle@ActiveState.com>
Date: 17 Sep 2005 00:13:41 -0700
Message-ID: <lrk6hgrwt6.fsf@caliper.activestate.com>
Subject: Re: Improved File::Spec::Win32->path [PATCH]
From: Michael G Schwern <schwern@pobox.com>
Date: Tue, 27 Sep 2005 13:05:54 -0700
Message-ID: <
20050927200554.GC20908@windhund.schwern.org>
p4raw-id: //depot/perl@25627
}
# path()
-my $had_path = exists $ENV{PATH};
{
- my @path_eg = ( qw( . .. ), 'C:\\Program Files' );
- local $ENV{PATH} = join ';', @path_eg;
- ok( eq_array( [ $MM->path() ], [ @path_eg ] ),
+ ok( eq_array( [ $MM->path() ], [ File::Spec->path ] ),
'path() [preset]' );
}
-# Bug in Perl. local $ENV{FOO} will not delete key afterwards.
-delete $ENV{PATH} unless $had_path;
# static_lib() should look into that
# dynamic_bs() should look into that
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.5';
+$VERSION = '1.5_01';
@ISA = qw(File::Spec::Unix);
}
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;
}