From: Alexander B. Schmidt Date: Sat, 3 Nov 2012 23:29:12 +0000 (+0100) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/974356cea3f71fcefd5a970cb6441e158e39b3ed ... --- 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);