Allow eliminate_macros() and fixpath() to handle space-delimited
authorCharles Bailey <bailey@newman.upenn.edu>
Thu, 25 May 2000 04:46:54 +0000 (04:46 +0000)
committerbailey <bailey@newman.upenn.edu>
Thu, 25 May 2000 04:46:54 +0000 (04:46 +0000)
       lists (based on fixes by Craig Berry)

p4raw-id: //depot/vmsperl@6121

lib/File/Spec/VMS.pm

index d2be87c..cc06ca6 100644 (file)
@@ -40,6 +40,11 @@ sub eliminate_macros {
     my($self,$path) = @_;
     return '' unless $path;
     $self = {} unless ref $self;
+
+    if ($path =~ /\s/) {
+      return join ' ', map { $self->eliminate_macros($_) } split /\s+/, $path;
+    }
+
     my($npath) = unixify($path);
     my($complex) = 0;
     my($head,$macro,$tail);
@@ -89,6 +94,12 @@ sub fixpath {
     $self = bless {} unless ref $self;
     my($fixedpath,$prefix,$name);
 
+    if ($path =~ /\s/) {
+      return join ' ',
+             map { $self->fixpath($_,$force_path) }
+            split /\s+/, $path;
+    }
+
     if ($path =~ m#^\$\([^\)]+\)\Z(?!\n)#s || $path =~ m#[/:>\]]#) { 
         if ($force_path or $path =~ /(?:DIR\)|\])\Z(?!\n)/) {
             $fixedpath = vmspath($self->eliminate_macros($path));