From 970a276fab0f12e34f9376eed718591496f74c62 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 3 Oct 2002 02:01:00 +0000 Subject: Fixed infinite loop finding zero width match at end of range. --- src/Document.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index 9854df677..747ccd8f2 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -915,7 +915,7 @@ long Document::FindText(int minPos, int maxPos, const char *s, lenRet = pre->eopat[0] - pre->bopat[0]; if (increment == -1) { // Check for the last match on this line. - while (success) { + while (success && (pre->eopat[0] < endOfLine)) { success = pre->Execute(di, pre->eopat[0], endOfLine); if (success) { if (pre->eopat[0] <= minPos) { -- cgit v1.2.3