diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-05-05 02:15:13 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-05-05 02:15:13 +0000 |
commit | 9c045eb230d3b294af134ce743669059dcb2f128 (patch) | |
tree | 159659aa44e55e762c5fcd299110ea0e1bb61a1d /lib/File/Spec/Mac.pm | |
parent | 8ea1e5d40997f61551f59d826b2e5dd24e71e6b0 (diff) | |
download | perl-9c045eb230d3b294af134ce743669059dcb2f128.tar.gz |
File::Spec compatibility update (from Barrie Slaymaker
<barries@slaysys.com>)
p4raw-id: //depot/perl@6069
Diffstat (limited to 'lib/File/Spec/Mac.pm')
-rw-r--r-- | lib/File/Spec/Mac.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm index eeb2d811fc..5315d9220f 100644 --- a/lib/File/Spec/Mac.pm +++ b/lib/File/Spec/Mac.pm @@ -82,9 +82,9 @@ sub catdir { shift; my @args = @_; my $result = shift @args; - $result =~ s/:\z//; + $result =~ s/:\Z(?!\n)//; foreach (@args) { - s/:\z//; + s/:\Z(?!\n)//; s/^://s; $result .= ":$_"; } @@ -153,7 +153,7 @@ sub rootdir { require Mac::Files; my $system = Mac::Files::FindFolder(&Mac::Files::kOnSystemDisk, &Mac::Files::kSystemFolderType); - $system =~ s/:.*\z/:/s; + $system =~ s/:.*\Z(?!\n)/:/s; return $system; } @@ -231,7 +231,7 @@ sub splitpath { my ($volume,$directory,$file) = ('','',''); if ( $nofile ) { - ( $volume, $directory ) = $path =~ m@((?:[^:]+(?::|\z))?)(.*)@s; + ( $volume, $directory ) = $path =~ m@((?:[^:]+(?::|\Z(?!\n)))?)(.*)@s; } else { $path =~ @@ -245,8 +245,8 @@ sub splitpath { } # Make sure non-empty volumes and directories end in ':' - $volume .= ':' if $volume =~ m@[^:]\z@ ; - $directory .= ':' if $directory =~ m@[^:]\z@ ; + $volume .= ':' if $volume =~ m@[^:]\Z(?!\n)@ ; + $directory .= ':' if $directory =~ m@[^:]\Z(?!\n)@ ; return ($volume,$directory,$file); } @@ -262,7 +262,7 @@ sub splitdir { # check to be sure that there will not be any before handling the # simple case. # - if ( $directories !~ m@:\z@ ) { + if ( $directories !~ m@:\Z(?!\n)@ ) { return split( m@:@, $directories ); } else { @@ -289,11 +289,11 @@ sub catpath { my $segment ; for $segment ( @_ ) { - if ( $result =~ m@[^/]\z@ && $segment =~ m@^[^/]@s ) { + if ( $result =~ m@[^/]\Z(?!\n)@ && $segment =~ m@^[^/]@s ) { $result .= "/$segment" ; } - elsif ( $result =~ m@/\z@ && $segment =~ m@^/@s ) { - $result =~ s@/+\z@/@; + elsif ( $result =~ m@/\Z(?!\n)@ && $segment =~ m@^/@s ) { + $result =~ s@/+\Z(?!\n)@/@; $segment =~ s@^/+@@s; $result .= "$segment" ; } |