From 974356cea3f71fcefd5a970cb6441e158e39b3ed Mon Sep 17 00:00:00 2001 From: "Alexander B. Schmidt" Date: Sun, 4 Nov 2012 00:29:12 +0100 Subject: [PATCH 1/1] ... --- configcache.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configcache.cpp b/configcache.cpp index 15c85f9..af0a206 100644 --- a/configcache.cpp +++ b/configcache.cpp @@ -112,6 +112,16 @@ bool configcache::readConfig() if( !inFile.is_open() ) continue; + std::streampos fsize = inFile.tellg(); + inFile.seekg( 0, std::ios::end ); + fsize = inFile.tellg() - fsize; + if( fsize == 0 ) { + *out->log << "CCACHE: dat-file has zero length! Skipping." << endl << flush; + inFile.close(); + continue; + } + inFile.seekg(0); + inBuffer = new boost::iostreams::filtering_istreambuf; inBuffer->push( boost::iostreams::bzip2_decompressor() ); inBuffer->push(inFile); -- 2.39.5