diff --git a/runzip.c b/runzip.c index 2839c98..2c88313 100644 --- a/runzip.c +++ b/runzip.c @@ -265,11 +265,11 @@ i64 runzip_fd(rzip_control *control, int fd_in, int fd_out, int fd_hist, i64 exp md5_init_ctx (&control->ctx); gettimeofday(&start,NULL); - while (total < expected_size || !total || !control->eof) { + do { total += runzip_chunk(control, fd_in, fd_out, fd_hist, expected_size, total); if (STDOUT) dump_tmpoutfile(control, fd_out); - } + } while (total < expected_size || (!expected_size && !control->eof)); gettimeofday(&end,NULL); print_progress("\nAverage DeCompression Speed: %6.3fMB/s\n", diff --git a/rzip.c b/rzip.c index 409c211..2ec758a 100644 --- a/rzip.c +++ b/rzip.c @@ -964,8 +964,6 @@ retry: /* st->chunk_size may be shrunk in rzip_chunk */ last_chunk = st->chunk_size; len -= st->chunk_size; - if (!len) - control->eof = 1; } close_streamout_threads(control); diff --git a/stream.c b/stream.c index ad2ce97..e22e909 100644 --- a/stream.c +++ b/stream.c @@ -962,7 +962,7 @@ void *open_stream_in(rzip_control *control, int f, int n) if (control->major_version == 0 && control->minor_version > 5) { /* Read in flag that tells us if there are more chunks after - * this */ + * this. Ignored if we know the final file size */ if (unlikely(read_u8(f, &control->eof))) { print_err("Failed to read eof flag in open_stream_in\n"); goto failed;