summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-09-20 13:58:52 +0200
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-09-20 13:58:52 +0200
commitf0542300a32fede4ac01061afeccc484e300112d (patch)
tree123678e347e80c6d8f8c752a554e9f4c2c75bb0d /lib
parenta5dbbe287dc82a0e6e5d73cf9da30bab2694031c (diff)
downloadperl-f0542300a32fede4ac01061afeccc484e300112d.tar.gz
perl 5.003_06: lib/File/Basename.pm
Date: Fri, 20 Sep 1996 14:11:05 +0200 From: Gisle Aas <aas@bergen.sn.no> 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 <aas@bergen.sn.no> Subject: File::Basename documentation patch Date: Mon, 30 Sep 1996 00:54:37 -0400 From: Spider Boardman <spider@Orb.Nashua.NH.US> 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 <bailey@HMIVAX.HUMGEN.UPENN.EDU> Subject: VMS patches to 5.003_05
Diffstat (limited to 'lib')
-rw-r--r--lib/File/Basename.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm
index 5823ef6228..2602f0d530 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;
}