diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2005-01-03 16:38:40 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2005-01-03 16:38:40 +0000 |
commit | d4f28b53147fa97f0f4feddf861804f6d9a8afed (patch) | |
tree | 826c53c61aa3266af16f16d6e297838c10b611b6 /Packdrakeng | |
parent | 068bd6155c75fdbc0b88846a9717fa52624dce7a (diff) | |
download | rpmtools-d4f28b53147fa97f0f4feddf861804f6d9a8afed.tar rpmtools-d4f28b53147fa97f0f4feddf861804f6d9a8afed.tar.gz rpmtools-d4f28b53147fa97f0f4feddf861804f6d9a8afed.tar.bz2 rpmtools-d4f28b53147fa97f0f4feddf861804f6d9a8afed.tar.xz rpmtools-d4f28b53147fa97f0f4feddf861804f6d9a8afed.zip |
- fix data read detection when using cache
Diffstat (limited to 'Packdrakeng')
-rw-r--r-- | Packdrakeng/zlib.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Packdrakeng/zlib.pm b/Packdrakeng/zlib.pm index 72fe9e2..2478649 100644 --- a/Packdrakeng/zlib.pm +++ b/Packdrakeng/zlib.pm @@ -153,8 +153,8 @@ sub gzip_uncompress { warn("Unable to uncompress data"); return -1; }; - $l = length($out) or next; } + $l = length($out) or next; if ($pack->{ustream_data}{read} < $fileinfo->{off} && $pack->{ustream_data}{read} + $l > $fileinfo->{off}) { $out = substr($out, $fileinfo->{off} - $pack->{ustream_data}{read}); } @@ -165,6 +165,7 @@ sub gzip_uncompress { if ($byteswritten + length($out) > $fileinfo->{size}) { $bw = $fileinfo->{size} - $byteswritten; $pack->{ustream_data}{buf} = substr($out, $bw); # keeping track of unwritten uncompressed data + $pack->{ustream_data}{read} -= length($pack->{ustream_data}{buf}); } else { $bw = length($out); } |