Re: [PATCH] Re: INSTALLSCRIPT versus INSTALLDIRS
[p5sagit/p5-mst-13.2.git] / lib / Tie / File.pm
index 2539324..dfd86cd 100644 (file)
@@ -7,7 +7,7 @@ use Fcntl 'O_CREAT', 'O_RDWR', 'LOCK_EX', 'LOCK_SH', 'O_WRONLY', 'O_RDONLY';
 sub O_ACCMODE () { O_RDONLY | O_RDWR | O_WRONLY }
 
 
-$VERSION = "0.97";
+$VERSION = "0.97_01";
 my $DEFAULT_MEMORY_SIZE = 1<<21;    # 2 megabytes
 my $DEFAULT_AUTODEFER_THRESHHOLD = 3; # 3 records
 my $DEFAULT_AUTODEFER_FILELEN_THRESHHOLD = 65536; # 16 disk blocksful
@@ -93,7 +93,7 @@ sub TIEARRAY {
     unless (seek $file, 1, SEEK_SET) {
       croak "$pack: your filehandle does not appear to be seekable";
     }
-    seek $file, 0, SEEK_SET     # put it back
+    seek $file, 0, SEEK_SET;    # put it back
     $fh = $file;                # setting binmode is the user's problem
   } elsif (ref $file) {
     croak "usage: tie \@array, $pack, filename, [option => value]...";
@@ -656,7 +656,7 @@ sub _mtwrite {
       if (@_) {
         $unwritten = $self->_downcopy($data, $end, $_[1] - $end);
       } else {
-        # Make the file longer to accomodate the last segment that doesn'
+        # Make the file longer to accommodate the last segment that doesn'
         $unwritten = $self->_downcopy($data, $end);
       }
     }
@@ -727,6 +727,7 @@ sub _downcopy {
     last if $writable eq "";
     $self->_seekb($pos);
     $self->_write_record($writable);
+    last if $last_read_was_short && $data eq "";
     $len -= $readsize if defined $len;
     $pos += $readsize;
   }