Re: [perl #41555] Bug in File::Find on Windows when target
[p5sagit/p5-mst-13.2.git] / lib / File / Fetch.pm
index 235b4e3..8c8b3f9 100644 (file)
@@ -23,7 +23,7 @@ use vars    qw[ $VERBOSE $PREFER_BIN $FROM_EMAIL $USER_AGENT
 use constant QUOTE  => do { $^O eq 'MSWin32' ? q["] : q['] };            
             
 
-$VERSION        = '0.13_04';
+$VERSION        = '0.14';
 $VERSION        = eval $VERSION;    # avoid warnings with development releases
 $PREFER_BIN     = 0;                # XXX TODO implement
 $FROM_EMAIL     = 'File-Fetch@example.com';
@@ -299,7 +299,7 @@ sub new {
 ###
 ### In the case of file:// urls there maybe be additional fields
 ###
-### For systems with volume specifications such as Win32 there will be
+### For systems with volume specifications such as Win32 there will be 
 ### a volume specifier provided in the 'vol' field.
 ###
 ###   'vol' => 'volumename'
@@ -418,7 +418,7 @@ sub fetch {
 
     check( $tmpl, \%hash ) or return;
 
-    # On VMS force to VMS format so File::Spec will work.
+    ### On VMS force to VMS format so File::Spec will work.
     $to = VMS::Filespec::vmspath($to) if ON_VMS;
 
     ### create the path if it doesn't exist yet ###
@@ -919,12 +919,12 @@ sub _file_fetch {
         $remote = "\\\\".$self->host."\\$share\\$path";
 
     } else {
-        if (ON_VMS) {
-            # File::Spec on VMS can not currently handle UNIX syntax.
-            $remote  = File::Spec::Unix->catfile( $path, $self->file );
-        } else {
-            $remote  = File::Spec->catfile( $path, $self->file );
-        }
+        ### File::Spec on VMS can not currently handle UNIX syntax.
+        my $file_class = ON_VMS
+            ? 'File::Spec::Unix'
+            : 'File::Spec';
+
+        $remote  = $file_class->catfile( $path, $self->file );
     }
 
     ### File::Copy is littered with 'die' statements :( ###