Fixed #155 (freeze after replacing nothing by something)

This commit is contained in:
Matthias Koefferlein 2018-08-13 09:04:13 +02:00
parent a8ad415fac
commit 1a7bcfc31c
1 changed files with 2 additions and 0 deletions

View File

@ -1004,6 +1004,8 @@ MacroEditorPage::replace_all (const QString &replace)
int i = m_current_search.indexIn (b.text (), o);
if (i < 0) {
break;
} else if (m_current_search.matchedLength () == 0) {
break; // avoid an infinite loop
}
QString r = interpolate_string (replace, m_current_search);