*! Read last .dsl line properly when it doesn't end with \n

This commit is contained in:
Konstantin Isakov 2009-05-12 15:39:18 +00:00
parent d10634d3fc
commit 496e1c873c
2 changed files with 2 additions and 7 deletions

View file

@ -68,7 +68,7 @@ DEF_EX_STR( exCantReadFile, "Can't read file", Dictionary::Ex )
enum
{
Signature = 0x584c5344, // DSLX on little-endian, XLSD on big-endian
CurrentFormatVersion = 11 + BtreeIndexing::FormatVersion + Folding::Version
CurrentFormatVersion = 12 + BtreeIndexing::FormatVersion + Folding::Version
};
struct IdxHeader

View file

@ -622,12 +622,7 @@ bool DslScanner::readNextLine( wstring & out, size_t & offset ) throw( Ex,
// Check that we have bytes to read
if ( readBufferLeft < 4 ) // To convert one char, we need at most 4 bytes
{
if ( gzeof( f ) )
{
if ( !readBufferLeft )
return false;
}
else
if ( !gzeof( f ) )
{
// To avoid having to deal with ring logic, we move the remaining bytes
// to the beginning