forked from mia/Aegisub
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
721d8aad79
commit
703ae3f7a6
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue