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/?a=commitdiff_plain;h=7abc9c3ed271ed787d57c2f074c9a696fb7b2572;p=libs%2Fdatafile.git 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 {