From: Perl 5 Porters Date: Fri, 20 Sep 1996 11:58:52 +0000 (+0200) Subject: perl 5.003_06: lib/File/Basename.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f0542300a32fede4ac01061afeccc484e300112d;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_06: lib/File/Basename.pm Date: Fri, 20 Sep 1996 14:11:05 +0200 From: Gisle Aas Subject: File::BaseName: "/" is legal path separator for MSDOS The File::BaseName module should allow "/" as path separator when fileparse_set_fstype("MSDOS") is in effect: Date: Fri, 20 Sep 1996 13:58:52 +0200 From: Gisle Aas Subject: File::Basename documentation patch Date: Mon, 30 Sep 1996 00:54:37 -0400 From: Spider Boardman For t/lib/basename.t, though, the associated patch for File::Basename was also wrong: Date: Thu, 03 Oct 1996 16:31:46 -0400 (EDT) From: Charles Bailey Subject: VMS patches to 5.003_05 --- diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index 5823ef6..2602f0d 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -77,7 +77,7 @@ would yield $base eq 'draft' $path eq '/virgil/aeneid/', - $tail eq '.book7' + $type eq '.book7' Similarly, using VMS syntax: @@ -118,7 +118,7 @@ require Exporter; @EXPORT = qw(fileparse fileparse_set_fstype basename dirname); #use strict; #use vars qw($VERSION $Fileparse_fstype); -$VERSION = "2.3"; +$VERSION = "2.4"; # fileparse_set_fstype() - specify OS-based rules used in future @@ -135,7 +135,7 @@ sub fileparse_set_fstype { # fileparse() - parse file specification # -# Version 2.3 4-Jul-1996 Charles Bailey bailey@genetics.upenn.edu +# Version 2.4 27-Sep-1996 Charles Bailey bailey@genetics.upenn.edu sub fileparse { @@ -146,18 +146,18 @@ sub fileparse { if ($fstype =~ /^VMS/i) { if ($fullname =~ m#/#) { $fstype = '' } # We're doing Unix emulation else { - ($dirpath,$basename) = ($fullname =~ /(.*[:>\]])?(.*)/); + ($dirpath,$basename) = ($fullname =~ /^(.*[:>\]])?(.*)/); } } if ($fstype =~ /^MSDOS/i) { - ($dirpath,$basename) = ($fullname =~ /(.*[:\\])?(.*)/); + ($dirpath,$basename) = ($fullname =~ /^(.*[:\\\/])?(.*)/); $dirpath .= '.\\' unless $dirpath =~ /\\$/; } elsif ($fstype =~ /^MacOS/i) { - ($dirpath,$basename) = ($fullname =~ /(.*:)?(.*)/); + ($dirpath,$basename) = ($fullname =~ /^(.*:)?(.*)/); } elsif ($fstype !~ /^VMS/i) { # default to Unix - ($dirpath,$basename) = ($fullname =~ m#(.*/)?(.*)#); + ($dirpath,$basename) = ($fullname =~ m#^(.*/)?(.*)#); $dirpath = './' unless $dirpath; }