From: Steve Peters Date: Thu, 12 Oct 2006 15:07:17 +0000 (+0000) Subject: Upgrade to PathTools-3.23. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c1e8580e8ecd78fc1f67b0caa695b9884a700d93;p=p5sagit%2Fp5-mst-13.2.git Upgrade to PathTools-3.23. p4raw-id: //depot/perl@29004 --- diff --git a/ext/Cwd/Changes b/ext/Cwd/Changes index 9fb4260..073b314 100644 --- a/ext/Cwd/Changes +++ b/ext/Cwd/Changes @@ -1,5 +1,12 @@ Revision history for Perl distribution PathTools. + - Yet more Win32 fixes (sigh... seems like I'm fighting a neverending + waterbed...). This time, fixed file_name_is_absolute() to know + what it's doing when the path includes a volume but a relative + path, like C:foo.txt . This bug had impact in rel2abs() on Win32 + too. + +3.22 - Mon Oct 9 21:50:52 2006 - Fixed the t/crossplatform.t test on Win32 (and possibly other volume-aware platforms) now that rel2abs() always adds a drive diff --git a/lib/Cwd.pm b/lib/Cwd.pm index fa5948c..c8b3602 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -171,7 +171,7 @@ use strict; use Exporter; use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); -$VERSION = '3.22'; +$VERSION = '3.23'; @ISA = qw/ Exporter /; @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); diff --git a/lib/File/Spec.pm b/lib/File/Spec.pm index f0e0844..ee6138c 100644 --- a/lib/File/Spec.pm +++ b/lib/File/Spec.pm @@ -3,7 +3,7 @@ package File::Spec; use strict; use vars qw(@ISA $VERSION); -$VERSION = '3.22'; +$VERSION = '3.23'; $VERSION = eval $VERSION; my %module = (MacOS => 'Mac', diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm index 6251f53..9bfcb18 100644 --- a/lib/File/Spec/Win32.pm +++ b/lib/File/Spec/Win32.pm @@ -82,10 +82,18 @@ sub case_tolerant { } sub file_name_is_absolute { + # As of right now, this returns 2 if the path is absolute with a + # volume, 1 if it's absolute with no volume, 0 otherwise. + my ($self,$file) = @_; - return $file =~ m{^$VOL_RX}os ? 2 : - $file =~ m{^[\\/]}is ? 1 : - 0; + + if ($file =~ m{^($VOL_RX)}o) { + my $vol = $1; + return ($vol =~ m{^$UNC_RX}o ? 2 + : $file =~ m{^$DRIVE_RX[\\/]}o ? 2 + : 0); + } + return $file =~ m{^[\\/]} ? 1 : 0; } =item catfile diff --git a/lib/File/Spec/t/Spec.t b/lib/File/Spec/t/Spec.t index f33efdd..e1e620d 100644 --- a/lib/File/Spec/t/Spec.t +++ b/lib/File/Spec/t/Spec.t @@ -278,6 +278,7 @@ if ($^O eq 'MacOS') { [ "FakeWin32->rel2abs('../temp','//prague_main/work/')", '\\\\prague_main\\work\\temp' ], [ "FakeWin32->rel2abs('temp','//prague_main/work')", '\\\\prague_main\\work\\temp' ], [ "FakeWin32->rel2abs('../','//prague_main/work')", '\\\\prague_main\\work' ], +[ "FakeWin32->rel2abs('D:foo.txt')", 'D:\\alpha\\beta\\foo.txt' ], [ "VMS->case_tolerant()", '1' ], @@ -622,9 +623,6 @@ if ($^O eq 'MacOS') { ) ; -if ($^O eq 'MSWin32') { - push @tests, [ "FakeWin32->rel2abs('D:foo.txt')", 'D:\\alpha\\beta\\foo.txt' ]; -} plan tests => scalar @tests;