prevent endless loop (bug 2121)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10630 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2005-11-29 13:39:03 +00:00
parent 08985cf16f
commit 238411b596
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2005-11-29 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* buffer_funcs.C (bufferErrors): prevent endless loop (bug 2121)
2005-11-17 Michael Gerz <michael.gerz@teststep.org>
* exporter.C: fix typo in text message

View File

@ -215,13 +215,15 @@ void bufferErrors(Buffer const & buf, TeXErrors const & terr)
int id_start = -1;
int pos_start = -1;
int errorrow = cit->error_in_line;
buf.texrow().getIdFromRow(errorrow, id_start, pos_start);
bool found = buf.texrow().getIdFromRow(errorrow, id_start,
pos_start);
int id_end = -1;
int pos_end = -1;
do {
++errorrow;
buf.texrow().getIdFromRow(errorrow, id_end, pos_end);
} while (id_start == id_end && pos_start == pos_end);
found = buf.texrow().getIdFromRow(errorrow, id_end,
pos_end);
} while (found && id_start == id_end && pos_start == pos_end);
buf.error(ErrorItem(cit->error_desc, cit->error_text,
id_start, pos_start, pos_end));