From 1a7bcfc31c397524135e77016b601c1c1485ffae Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 13 Aug 2018 09:04:13 +0200 Subject: [PATCH] Fixed #155 (freeze after replacing nothing by something) --- src/lay/lay/layMacroEditorPage.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lay/lay/layMacroEditorPage.cc b/src/lay/lay/layMacroEditorPage.cc index f82350c44..eb5eceb26 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -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);