diff options
author | nyamatongwe <unknown> | 2003-03-06 11:04:20 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-03-06 11:04:20 +0000 |
commit | 39423285f19cd5ea17985fe0c75fe9801538f4da (patch) | |
tree | bc29a8282d5e9daefac4ca61903a0194bd38b90d /src/Document.cxx | |
parent | fa9b19097f47b2740666b7bd305c2c335a90326b (diff) | |
download | scintilla-mirror-39423285f19cd5ea17985fe0c75fe9801538f4da.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) { |