mirror of https://github.com/KLayout/klayout.git
Fixed #155 (freeze after replacing nothing by something)
This commit is contained in:
parent
a8ad415fac
commit
1a7bcfc31c
|
|
@ -1004,6 +1004,8 @@ MacroEditorPage::replace_all (const QString &replace)
|
||||||
int i = m_current_search.indexIn (b.text (), o);
|
int i = m_current_search.indexIn (b.text (), o);
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
break;
|
break;
|
||||||
|
} else if (m_current_search.matchedLength () == 0) {
|
||||||
|
break; // avoid an infinite loop
|
||||||
}
|
}
|
||||||
|
|
||||||
QString r = interpolate_string (replace, m_current_search);
|
QString r = interpolate_string (replace, m_current_search);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue