X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCwd.pm;h=002b7c118382aeb704830e4bd0304009df7c92bb;hb=b04f6d364dc3b26d2309e24417e692690629b145;hp=cf07cb484d18a4e30d83ca9d1a8e295513ba7972;hpb=99f36a739b86a289062066efb312754683ab485a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Cwd.pm b/lib/Cwd.pm index cf07cb4..002b7c1 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -170,7 +170,7 @@ use strict; use Exporter; use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); -$VERSION = '3.04'; +$VERSION = '3.05'; @ISA = qw/ Exporter /; @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); @@ -199,15 +199,16 @@ if ($^O eq 'os2') { return 1; } +# If loading the XS stuff doesn't work, we can fall back to pure perl eval { -if ( $] >= 5.006 ) { - require XSLoader; - XSLoader::load( __PACKAGE__, $VERSION ); -} else { - require DynaLoader; - push @ISA, 'DynaLoader'; - __PACKAGE__->bootstrap( $VERSION ); -} + if ( $] >= 5.006 ) { + require XSLoader; + XSLoader::load( __PACKAGE__, $VERSION ); + } else { + require DynaLoader; + push @ISA, 'DynaLoader'; + __PACKAGE__->bootstrap( $VERSION ); + } }; # Must be after the DynaLoader stuff: @@ -583,7 +584,9 @@ sub fast_abs_path { return fast_abs_path($link_target); } - return $dir eq File::Spec->rootdir + my $tdir = $dir; + $tdir =~ s!\\!/!g if $^O eq 'MSWin32'; + return $tdir eq File::Spec->rootdir ? File::Spec->catpath($vol, $dir, $file) : fast_abs_path(File::Spec->catpath($vol, $dir, '')) . '/' . $file; }