Commits

Joe Topjian committed 79c0980

Fixed some logic concerning truncated files

  • Participants
  • Parent commits c1069ff

Comments (0)

Files changed (1)

                         # If the range was not properly found,
                         # something might be wrong with the file.
                         # Break and re-download.
-                        $selected = 'external' if ( !defined $start );
+                        if ( !defined $start ) {
+                            $selected = 'external';
+                        }
+                        else {
+                            open my $fh, '<', "$mirror_root/$file" or die($!);
+                            seek( $fh, $start, 0 ) or die($!);
+                            my $return_value = read( $fh, $content, $stop );
 
-                        open my $fh, '<', "$mirror_root/$file" or die($!);
-                        seek( $fh, $start, 0 ) or die($!);
-                        my $return_value = read( $fh, $content, $stop );
-
-                        die($!) if !defined $return_value;
-                        close($fh);
+                            die($!) if !defined $return_value;
+                            close($fh);
+                        }
                     }
                     else {