1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

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.
This commit is contained in:
Lasse Collin 2013-07-04 13:25:11 +03:00
parent 736903c64b
commit ea00545bea

View file

@ -565,9 +565,9 @@ coder_normal(file_pair *pair)
strm.avail_out = IO_BUFFER_SIZE; strm.avail_out = IO_BUFFER_SIZE;
while (!user_abort) { while (!user_abort) {
// Fill the input buffer if it is empty and we haven't reached // Fill the input buffer if it is empty and we aren't
// end of file yet. // flushing or finishing.
if (strm.avail_in == 0 && !pair->src_eof) { if (strm.avail_in == 0 && action == LZMA_RUN) {
strm.next_in = in_buf.u8; strm.next_in = in_buf.u8;
strm.avail_in = io_read(pair, &in_buf, strm.avail_in = io_read(pair, &in_buf,
my_min(block_remaining, my_min(block_remaining,