diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-03-23 22:17:45 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-03-23 22:17:45 +0000 |
commit | f505c9832e74f948e2721f6c36b348502f15804c (patch) | |
tree | bfa4641f68bd2b663097c30a4dc8abf7e266a367 /lib/File | |
parent | 9ffcd8612a179e6a837df3e98019ae7fe24b4fa1 (diff) | |
download | perl-f505c9832e74f948e2721f6c36b348502f15804c.tar.gz |
File::Spec fixes from Jan Dubois <jan.dubois@ibm.net>
Date: Sat, 06 Mar 1999 17:50:49 +0100
Message-ID: <36e25209.33833760@smtp1.ibm.net>
Subject: [PATCH 5.005_56] Fixes for File::Spec::Functions.pm
--
Date: Sat, 06 Mar 1999 18:15:00 +0100
Message-ID: <36e36222.37954195@smtp1.ibm.net>
Subject: [PATCH 5.005_56] Fix for File::Spec::Win32.pm
p4raw-id: //depot/perl@3132
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/Spec/Functions.pm | 22 | ||||
-rw-r--r-- | lib/File/Spec/Win32.pm | 2 |
2 files changed, 16 insertions, 8 deletions
diff --git a/lib/File/Spec/Functions.pm b/lib/File/Spec/Functions.pm index 77561abf09..ffc1199523 100644 --- a/lib/File/Spec/Functions.pm +++ b/lib/File/Spec/Functions.pm @@ -3,7 +3,7 @@ package File::Spec::Functions; use File::Spec; use strict; -use vars qw(@ISA @EXPORT); +use vars qw(@ISA @EXPORT @EXPORT_OK); require Exporter; @@ -14,13 +14,16 @@ require Exporter; catdir catfile curdir - devnull rootdir - tmpdir updir no_upwards file_name_is_absolute path +); + +@EXPORT_OK = qw( + devnull + tmpdir splitpath splitdir catpath @@ -28,9 +31,10 @@ require Exporter; rel2abs ); -foreach my $meth (@EXPORT) { +foreach my $meth (@EXPORT, @EXPORT_OK) { + my $sub = File::Spec->can($meth); no strict 'refs'; - *{$meth} = File::Spec->can($meth); + *{$meth} = sub {&$sub('File::Spec', @_)}; } @@ -64,13 +68,17 @@ The following functions are exported by default. catdir catfile curdir - devnull rootdir - tmpdir updir no_upwards file_name_is_absolute path + + +The following functions are exported only by request. + + devnull + tmpdir splitpath splitdir catpath diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm index 0e00af711d..0ea4970b41 100644 --- a/lib/File/Spec/Win32.pm +++ b/lib/File/Spec/Win32.pm @@ -99,7 +99,7 @@ sub canonpath { my ($self,$path,$reduce_ricochet) = @_; $path =~ s/^([a-z]:)/\u$1/; $path =~ s|/|\\|g; - $path =~ s|([^\\])\\+|\1\\|g; # xx////xx -> xx/xx + $path =~ s|([^\\])\\+|$1\\|g; # xx////xx -> xx/xx $path =~ s|(\\\.)+\\|\\|g; # xx/././xx -> xx/xx $path =~ s|^(\.\\)+|| unless $path eq ".\\"; # ./xx -> xx $path =~ s|\\$|| |