develooper Front page | perl.perl5.porters | Postings from March 2000

[PATCH 5.5.670] More File::* cleanups

From:
Greg Bacon
Date:
March 1, 2000 07:57
Subject:
[PATCH 5.5.670] More File::* cleanups
Message ID:
200003011605.KAA20280@ruby.itsc.uah.edu
diff -ru perl-5.5.670.dist/lib/File/Spec/Mac.pm perl-5.5.670/lib/File/Spec/Mac.pm
--- perl-5.5.670.dist/lib/File/Spec/Mac.pm	Tue Feb 29 02:03:09 2000
+++ perl-5.5.670/lib/File/Spec/Mac.pm	Wed Mar  1 09:56:51 2000
@@ -150,7 +150,7 @@
     require Mac::Files;
     my $system =  Mac::Files::FindFolder(&Mac::Files::kOnSystemDisk,
 					 &Mac::Files::kSystemFolderType);
-    $system =~ s/:.*\z/:/;
+    $system =~ s/:.*\z/:/s;
     return $system;
 }
 
@@ -228,7 +228,7 @@
     my ($volume,$directory,$file) = ('','','');
 
     if ( $nofile ) {
-        ( $volume, $directory ) = $path =~ m@((?:[^:]+(?::|\z))?)(.*)@;
+        ( $volume, $directory ) = $path =~ m@((?:[^:]+(?::|\z))?)(.*)@s;
     }
     else {
         $path =~ 
diff -ru perl-5.5.670.dist/lib/File/Spec/VMS.pm perl-5.5.670/lib/File/Spec/VMS.pm
--- perl-5.5.670.dist/lib/File/Spec/VMS.pm	Tue Feb 29 02:08:17 2000
+++ perl-5.5.670/lib/File/Spec/VMS.pm	Wed Mar  1 10:01:54 2000
@@ -41,7 +41,7 @@
     my($head,$macro,$tail);
 
     # perform m##g in scalar context so it acts as an iterator
-    while ($npath =~ m#(.*?)\$\((\S+?)\)(.*)#g) { 
+    while ($npath =~ m#(.*?)\$\((\S+?)\)(.*)#gs) { 
         if ($self->{$2}) {
             ($head,$macro,$tail) = ($1,$2,$3);
             if (ref $self->{$macro}) {
@@ -59,7 +59,7 @@
             $npath = "$head$macro$tail";
         }
     }
-    if ($complex) { $npath =~ s#\cB(.*?)\cB#\${$1}#g; }
+    if ($complex) { $npath =~ s#\cB(.*?)\cB#\${$1}#gs; }
     $npath;
 }
 
@@ -135,7 +135,7 @@
     my($self,$path,$reduce_ricochet) = @_;
 
     if ($path =~ m|/|) { # Fake Unix
-      my $pathify = $path =~ m|/$|;
+      my $pathify = $path =~ m|/\z|;
       $path = $self->SUPER::canonpath($path,$reduce_ricochet);
       if ($pathify) { return vmspath($path); }
       else          { return vmsify($path);  }
@@ -165,7 +165,7 @@
     if (@dirs) {
 	my $path = (@dirs == 1 ? $dirs[0] : $self->catdir(@dirs));
 	my ($spath,$sdir) = ($path,$dir);
-	$spath =~ s/.dir\z//; $sdir =~ s/.dir\z//; 
+	$spath =~ s/\.dir\z//; $sdir =~ s/\.dir\z//; 
 	$sdir = $self->eliminate_macros($sdir) unless $sdir =~ /^[\w\-]+\z/s;
 	$rslt = $self->fixpath($self->eliminate_macros($spath)."/$sdir",1);
 
@@ -197,7 +197,7 @@
     if (@files) {
 	my $path = (@files == 1 ? $files[0] : $self->catdir(@files));
 	my $spath = $path;
-	$spath =~ s/.dir\z//;
+	$spath =~ s/\.dir\z//;
 	if ($spath =~ /^[^\)\]\/:>]+\)\z/s && basename($file) eq $file) {
 	    $rslt = "$spath$file";
 	}
@@ -349,7 +349,7 @@
 sub catpath {
     my($self,$dev,$dir,$file) = @_;
     if ($dev =~ m|^/+([^/]+)|) { $dev =~ "$1:"; }
-    else { $dev .= ':' unless $dev eq '' or $dev =~ /:$/; }
+    else { $dev .= ':' unless $dev eq '' or $dev =~ /:\z/; }
     $dir = vmspath($dir);
     "$dev$dir$file";
 }
@@ -377,7 +377,7 @@
     if ( $path =~ m{/} ) {
         $path =~ 
             m{^ ( (?: /[^/]* )? )
-                ( (?: .*/(?:[^/]+.dir)? )? )
+                ( (?: .*/(?:[^/]+\.dir)? )? )
                 (.*)
              }xs;
         $volume    = $1;
End of Patch.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About