Fix #859, or rather work around it. There's no good way to detect problematic regexes like the example, and the regex engine lies in wx, so we'll have to do with what wx offers. Put a limit of at most 1000 replacements per line processed, that "should be enough for everyone", and avoids infinite looping.

(Also 3000 GET!)

Originally committed to SVN as r3000.
This commit is contained in:
Niels Martin Hansen 2009-06-01 15:44:59 +00:00
parent 386cc9d3cd
commit f13d23509a
1 changed files with 1 additions and 1 deletions

View File

@ -476,7 +476,7 @@ void SearchReplaceEngine::ReplaceAll() {
if (isReg) {
wxRegEx reg(LookFor,regFlags);
if (reg.IsValid()) {
size_t reps = reg.ReplaceAll(Text,ReplaceWith);
size_t reps = reg.Replace(Text,ReplaceWith,1000);
if (reps > 0) replaced = true;
count += reps;
}