From c61cb502c1bb06b5ff93a6766c500c17f1e7dcc0 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Tue, 15 Sep 2015 08:17:01 +0200 Subject: No output doesn't necessarily mean EOF --- src/io/izlibstream.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/io/izlibstream.cpp') diff --git a/src/io/izlibstream.cpp b/src/io/izlibstream.cpp index 632f0cf7c6..9079489507 100644 --- a/src/io/izlibstream.cpp +++ b/src/io/izlibstream.cpp @@ -65,6 +65,7 @@ inflate_streambuf::int_type inflate_streambuf::underflow() zstr.avail_out = out.size(); int ret = inflate(&zstr, Z_NO_FLUSH); + have = out.size() - zstr.avail_out; switch(ret) { case Z_NEED_DICT: @@ -73,10 +74,11 @@ inflate_streambuf::int_type inflate_streambuf::underflow() case Z_MEM_ERROR: throw std::bad_alloc(); case Z_STREAM_END: - return traits_type::eof(); + if(have == 0) + return traits_type::eof(); + break; } - have = out.size() - zstr.avail_out; } while(have == 0); setg(out.data(), out.data(), out.data() + have); -- cgit 0.0.5-2-1-g0f52