From: Mikko Rasa Date: Tue, 17 Dec 2013 01:01:06 +0000 (+0200) Subject: Detect eof from the parser, not input file X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=commitdiff_plain;h=7abc9c3ed271ed787d57c2f074c9a696fb7b2572;hp=7feeeacf8fa3eae889cb256c42ada615c4761eec Detect eof from the parser, not input file Some files have an embedded logical eof, so waiting for the end of the physical file would (and did) cause an infinite loop. --- diff --git a/tool/packer.cpp b/tool/packer.cpp index ff69912..3576472 100644 --- a/tool/packer.cpp +++ b/tool/packer.cpp @@ -79,7 +79,7 @@ bool Packer::detect_raw(IO::Seekable &in) IO::SeekOffset offset = in.tell(); bool raw = false; DataFile::Parser parser(in, "-"); - while(!raw && !in.eof() && in.tell()<10240) + while(!raw && parser && in.tell()<10240) { try {