summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2006-04-28 13:34:39 +0000
committerSteve Peters <steve@fisharerojo.org>2006-04-28 13:34:39 +0000
commitff235dd6d6f5e19e11c9202d4a82fb8e5fbadadd (patch)
treef32629532d8a4f4c2ebee0287f84c402a938e266 /lib
parent7e35a6a8bf1225db0ee95fcad4562a278d354f34 (diff)
downloadperl-ff235dd6d6f5e19e11c9202d4a82fb8e5fbadadd.tar.gz
Upgrade to Pathtools-3.18
p4raw-id: //depot/perl@28001
Diffstat (limited to 'lib')
-rw-r--r--lib/Cwd.pm2
-rw-r--r--lib/File/Spec.pm2
-rw-r--r--lib/File/Spec/VMS.pm18
-rw-r--r--lib/File/Spec/t/Spec.t13
4 files changed, 25 insertions, 10 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index 21cc263a5f..755c7a7795 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.17';
+$VERSION = '3.18';
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
diff --git a/lib/File/Spec.pm b/lib/File/Spec.pm
index 9aac374c13..7a3dd2614a 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.17';
+$VERSION = '3.18';
$VERSION = eval $VERSION;
my %module = (MacOS => 'Mac',
diff --git a/lib/File/Spec/VMS.pm b/lib/File/Spec/VMS.pm
index 539a93bcb4..f8c488d51c 100644
--- a/lib/File/Spec/VMS.pm
+++ b/lib/File/Spec/VMS.pm
@@ -85,9 +85,10 @@ cases (e.g. elements other than the first being absolute filespecs).
=cut
sub catdir {
- my ($self,@dirs) = @_;
- my $dir = pop @dirs;
- @dirs = grep($_,@dirs);
+ my $self = shift;
+ my $dir = pop;
+ my @dirs = grep {defined() && length()} @_;
+
my $rslt;
if (@dirs) {
my $path = (@dirs == 1 ? $dirs[0] : $self->catdir(@dirs));
@@ -118,9 +119,10 @@ VMS-syntax file specification.
=cut
sub catfile {
- my ($self,@files) = @_;
- my $file = $self->canonpath(pop @files);
- @files = grep($_,@files);
+ my $self = shift;
+ my $file = $self->canonpath(pop());
+ my @files = grep {defined() && length()} @_;
+
my $rslt;
if (@files) {
my $path = (@files == 1 ? $files[0] : $self->catdir(@files));
@@ -131,7 +133,7 @@ sub catfile {
}
else {
$rslt = $self->eliminate_macros($spath);
- $rslt = vmsify($rslt.($rslt ? '/' : '').unixify($file));
+ $rslt = vmsify($rslt.((defined $rslt) && ($rslt ne '') ? '/' : '').unixify($file));
}
}
else { $rslt = (defined($file) && length($file)) ? vmsify($file) : ''; }
@@ -425,7 +427,7 @@ sub rel2abs {
# patch the ones in ExtUtils::MM_VMS instead.
sub eliminate_macros {
my($self,$path) = @_;
- return '' unless $path;
+ return '' unless (defined $path) && ($path ne '');
$self = {} unless ref $self;
if ($path =~ /\s/) {
diff --git a/lib/File/Spec/t/Spec.t b/lib/File/Spec/t/Spec.t
index e7e5b11825..c9318668e8 100644
--- a/lib/File/Spec/t/Spec.t
+++ b/lib/File/Spec/t/Spec.t
@@ -90,6 +90,7 @@ if ($^O eq 'MacOS') {
[ "Unix->catdir('d1','d2','d3','')", 'd1/d2/d3' ],
[ "Unix->catdir('','d1','d2','d3')", '/d1/d2/d3' ],
[ "Unix->catdir('d1','d2','d3')", 'd1/d2/d3' ],
+[ "Unix->catdir('/','d2/d3')", '/d2/d3' ],
[ "Unix->canonpath('///../../..//./././a//b/.././c/././')", '/a/b/../c' ],
[ "Unix->canonpath('')", '' ],
@@ -113,6 +114,8 @@ if ($^O eq 'MacOS') {
[ "Unix->abs2rel('/.','/t1/t2/t3')", '../../..' ],
[ "Unix->abs2rel('/./','/t1/t2/t3')", '../../..' ],
#[ "Unix->abs2rel('../t4','/t1/t2/t3')", '../t4' ],
+[ "Unix->abs2rel('/t1/t2/t3', '/')", 't1/t2/t3' ],
+[ "Unix->abs2rel('/t1/t2/t3', '/t1')", 't2/t3' ],
[ "Unix->rel2abs('t4','/t1/t2/t3')", '/t1/t2/t3/t4' ],
[ "Unix->rel2abs('t4/t5','/t1/t2/t3')", '/t1/t2/t3/t4/t5' ],
@@ -276,6 +279,15 @@ if ($^O eq 'MacOS') {
[ "VMS->catfile('c')", 'c' ],
[ "VMS->catfile('[]c')", 'c' ],
+[ "VMS->catfile('0','b','c')", '[.0.b]c' ],
+[ "VMS->catfile('a','0','c')", '[.a.0]c' ],
+[ "VMS->catfile('a','b','0')", '[.a.b]0' ],
+[ "VMS->catfile('0','0','c')", '[.0.0]c' ],
+[ "VMS->catfile('a','0','0')", '[.a.0]0' ],
+[ "VMS->catfile('0','b','0')", '[.0.b]0' ],
+[ "VMS->catfile('0','0','0')", '[.0.0]0' ],
+
+
[ "VMS->splitpath('file')", ',,file' ],
[ "VMS->splitpath('[d1.d2.d3]')", ',[d1.d2.d3],' ],
[ "VMS->splitpath('[.d1.d2.d3]')", ',[.d1.d2.d3],' ],
@@ -598,6 +610,7 @@ if ($^O eq 'MacOS') {
#[ "Epoc->canonpath('/.')", '/' ],
[ "Cygwin->case_tolerant()", '0' ],
+[ "Cygwin->catdir('/','d2/d3')", '/d2/d3' ],
) ;