aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2013-07-04 13:25:11 +0300
committerLasse Collin <lasse.collin@tukaani.org>2013-07-04 13:25:11 +0300
commitea00545beace5b950f709ec21e46878e0f448678 (patch)
treee58d43863fa1851ca83201efb6ffb481a6165ff2
parentxz: Move some of the timing code into mytime.[hc]. (diff)
downloadxz-ea00545beace5b950f709ec21e46878e0f448678.tar.xz
xz: Fix the test when to read more input.
Testing for end of file was no longer correct after full flushing became possible with --block-size=SIZE and --block-list=SIZES. There was no bug in practice though because xz just made a few unneeded zero-byte reads.
-rw-r--r--src/xz/coder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xz/coder.c b/src/xz/coder.c
index 897ff6a9..d29e40f4 100644
--- a/src/xz/coder.c
+++ b/src/xz/coder.c
@@ -565,9 +565,9 @@ coder_normal(file_pair *pair)
strm.avail_out = IO_BUFFER_SIZE;
while (!user_abort) {
- // Fill the input buffer if it is empty and we haven't reached
- // end of file yet.
- if (strm.avail_in == 0 && !pair->src_eof) {
+ // Fill the input buffer if it is empty and we aren't
+ // flushing or finishing.
+ if (strm.avail_in == 0 && action == LZMA_RUN) {
strm.next_in = in_buf.u8;
strm.avail_in = io_read(pair, &in_buf,
my_min(block_remaining,