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:
parent
386cc9d3cd
commit
f13d23509a
1 changed files with 1 additions and 1 deletions
|
@ -476,7 +476,7 @@ void SearchReplaceEngine::ReplaceAll() {
|
||||||
if (isReg) {
|
if (isReg) {
|
||||||
wxRegEx reg(LookFor,regFlags);
|
wxRegEx reg(LookFor,regFlags);
|
||||||
if (reg.IsValid()) {
|
if (reg.IsValid()) {
|
||||||
size_t reps = reg.ReplaceAll(Text,ReplaceWith);
|
size_t reps = reg.Replace(Text,ReplaceWith,1000);
|
||||||
if (reps > 0) replaced = true;
|
if (reps > 0) replaced = true;
|
||||||
count += reps;
|
count += reps;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue