From 238411b596b3683ee641e9c46857088c06cdc406 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Tue, 29 Nov 2005 13:39:03 +0000 Subject: [PATCH] prevent endless loop (bug 2121) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10630 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/buffer_funcs.C | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 08b99e4c7f..22ab20f2da 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-11-29 Georg Baum + + * buffer_funcs.C (bufferErrors): prevent endless loop (bug 2121) + 2005-11-17 Michael Gerz * exporter.C: fix typo in text message diff --git a/src/buffer_funcs.C b/src/buffer_funcs.C index ef0b89ebfe..18e04b835d 100644 --- a/src/buffer_funcs.C +++ b/src/buffer_funcs.C @@ -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)); -- 2.39.2