From 8c8642fdfac75467d30ebc2882a75e1fc74d3db8 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Mon, 5 Nov 2012 20:05:58 +0400 Subject: [PATCH] Call gzrewind() before gzseek() for uncompressed files --- dsl_details.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dsl_details.cc b/dsl_details.cc index 20f3c710..cca45b20 100644 --- a/dsl_details.cc +++ b/dsl_details.cc @@ -654,6 +654,8 @@ DslScanner::DslScanner( string const & fileName ) throw( Ex, Iconv::Ex ): // We need to rewind to that line so readNextLine() would return it again // next time it's called. To do that, we just use the slow gzseek() and // empty the read buffer. + if( gzdirect( f ) ) // Without this ZLib 1.2.7 gzread() return 0 + gzrewind( f ); // after gzseek() call on uncompressed files gzseek( f, offset, SEEK_SET ); readBufferPtr = readBuffer; readBufferLeft = 0;