This commit is contained in:
Dick Hollenbeck 2011-01-05 15:21:32 -06:00
parent 62a4072c92
commit c42af9387d
1 changed files with 3 additions and 2 deletions

View File

@ -346,17 +346,18 @@ int DSNLEXER::NextTok() throw( IO_ERROR )
if( cur >= limit )
{
L_read:
cur = start;
// blank lines are returned as "\n" and will have a len of 1.
// EOF will have a len of 0 and so is detectable.
int len = readLine();
if( len == 0 )
{
cur = start; // after readLine(), since start can change, set cur offset to start
curTok = DSN_EOF;
goto exit;
}
cur = start; // after readLine() since start can change.
// skip leading whitespace
while( cur<limit && isSpace(*cur) )
++cur;