Fixed #4505 (test/testtokenize.cpp: Assertion failed in 'make check')

This commit is contained in:
Erik Lax 2013-01-23 18:27:28 +01:00 committed by Daniel Marjamäki
parent cecd726b11
commit 569b2ae9cd
1 changed files with 4 additions and 12 deletions

View File

@ -294,19 +294,11 @@ bool TokenList::createTokens(std::istream &code, const std::string& file0)
std::getline(code, line);
// Update the current line number
std::string::size_type n = 0;
while (n < line.size() && std::isspace(line[n]))
++n;
if (n == line.size())
unsigned int row;
if (!(std::stringstream(line) >> row))
++lineno;
else {
while (n < line.size() && std::isdigit(line[n]))
++n;
if (n < line.size() && !std::isspace(line[n]))
++lineno;
else
std::istringstream(line) >> lineno;
}
else
lineno = row;
CurrentToken.clear();
continue;
} else if (CurrentToken == "#endfile") {