--- /usr/include/boost/iostreams/filter/bzip2.hpp 2014-01-16 11:18:59.000000000 -0500 +++ bzip2.hpp 2015-05-19 23:12:47.620258277 -0400 @@ -350,6 +350,8 @@ ( const char*& src_begin, const char* src_end, char*& dest_begin, char* dest_end, bool flush ) { + int result; + do { if (eof_) { // reset the stream if there are more characters if(src_begin == src_end) @@ -360,12 +362,13 @@ if (!ready()) init(); before(src_begin, src_end, dest_begin, dest_end); - int result = decompress(); + result = decompress(); if(result == bzip2::ok && flush) result = check_end(src_begin, dest_begin); after(src_begin, dest_begin); bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result); eof_ = result == bzip2::stream_end; + } while (result == bzip2::stream_end && src_begin != src_end); return true; }