This commit is contained in:
Vitor Santos Costa
2018-11-17 23:39:55 +00:00
parent 9b31c93a46
commit 17411a7384
5 changed files with 74 additions and 68 deletions

View File

@@ -401,14 +401,13 @@ static Term syntax_error(TokEntry *errtok, int sno, Term cmod, Int newpos, bool
#endif
if (GLOBAL_Stream[sno].status & Seekable_Stream_f)
{
while (tok)
{
if (tok->Tok != Error_tok)
while (tok && tok->Tok != Error_tok && tok != errtok)
{
tok = tok->TokNext;
if (tok->TokNext)
tok = tok->TokNext;
else
break;
}
break;
}
err_line = tok->TokLine;
errpos = tok->TokPos -1;
if (errpos <= startpos)