diff options
author | nyamatongwe <devnull@localhost> | 2003-03-06 11:04:20 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2003-03-06 11:04:20 +0000 |
commit | e7af67b8e72bee50b84337d6ee71062e08e1abda (patch) | |
tree | bc29a8282d5e9daefac4ca61903a0194bd38b90d /src/Document.cxx | |
parent | e1fc20321527b6228dacda75db49be3437977499 (diff) | |
download | scintilla-mirror-e7af67b8e72bee50b84337d6ee71062e08e1abda.tar.gz |
Avoiding infinite loop in regex search backwards for ^
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index a1d5beff6..a7dcccb0c 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -919,7 +919,8 @@ 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 && (pre->eopat[0] < endOfLine)) { + int repetitions = 1000; // Break out of infinite loop + while (success && (pre->eopat[0] < endOfLine) && (repetitions--)) { success = pre->Execute(di, pre->eopat[0], endOfLine); if (success) { if (pre->eopat[0] <= minPos) { |