diff options
author | Chris Nandor <pudge@pobox.com> | 2001-02-12 19:02:43 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-02-13 14:22:50 +0000 |
commit | 084592ab0b76f3cbd4d089afb08ccea7ba1c9dd8 (patch) | |
tree | 8a175b8128ee3a57f4f96b96a3290adb0eb07399 /lib/File | |
parent | 67127a85e86d9ef67c9a136224ffce237c7df32b (diff) | |
download | perl-084592ab0b76f3cbd4d089afb08ccea7ba1c9dd8.tar.gz |
buncha MacPerl patches for bleadperl
Message-Id: <p05010404b6ae6f85e07a@[10.0.1.177]>
p4raw-id: //depot/perl@8792
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/Basename.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index 75996f2d08..94aac2dd44 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -240,7 +240,13 @@ sub dirname { if ($_[0] =~ m#/#) { $fstype = '' } else { return $dirname || $ENV{DEFAULT} } } - if ($fstype =~ /MacOS/i) { return $dirname } + if ($fstype =~ /MacOS/i) { + if( !length($basename) && $dirname !~ /^[^:]+:\z/) { + $dirname =~ s/([^:]):\z/$1/s; + ($basename,$dirname) = fileparse $dirname; + } + $dirname .= ":" unless $dirname =~ /:\z/; + } elsif ($fstype =~ /MSDOS/i) { $dirname =~ s/([^:])[\\\/]*\z/$1/; unless( length($basename) ) { @@ -260,7 +266,7 @@ sub dirname { chop $dirname; $dirname =~ s#[^:/]+\z## unless length($basename); } - else { + else { $dirname =~ s:(.)/*\z:$1:s; unless( length($basename) ) { local($File::Basename::Fileparse_fstype) = $fstype; |