Commit 108cab32 authored by Johnny Jazeix's avatar Johnny Jazeix

Fix bug #10476

parent d635a042
......@@ -121,7 +121,8 @@ int PajeFileManager::get_line(PajeLine *lineptr) {
memset(_line, 0, _PAJE_BUFSIZE);
getline(_line, _PAJE_BUFSIZE);
if (eof()) {
if (rdstate() != ifstream::goodbit) {
setstate(ifstream::eofbit); // We stop the reading if something happens to the state of the file.
lineptr->_nbtks = 0;
return _lineid;
}
......@@ -231,9 +232,7 @@ int PajeFileManager::get_line(PajeLine *lineptr) {
}
// We remove the last token if it is empty
if(itks == 0)
_tokens[itks][0] == '\0';
else if (_tokens[itks-1][0] == '\0')
if ((itks > 0) && (_tokens[itks-1][0] == '\0'))
itks--;
_nbtks = itks;
......
......@@ -96,7 +96,7 @@ void ParserPaje::parse(Trace &trace,
return;
}
while( (!(_file->eof())) || (_is_canceled) ) {
while( (!(_file->eof())) && !(_is_canceled) ) {
try {
_file->get_line(&line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment