From 5b46ae79b52a03313dabdfa245af255d60366bd3 Mon Sep 17 00:00:00 2001 From: mae <qt-info@nokia.com> Date: Mon, 26 Apr 2010 19:37:19 +0200 Subject: [PATCH] Fix hangup with regular expression search and 0-size match --- src/plugins/texteditor/basetexteditor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 6c2f4b6a710..18547bb8794 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -1974,6 +1974,8 @@ void BaseTextEditorPrivate::highlightSearchResults(const QTextBlock &block, if (idx < 0) break; l = m_searchExpr.matchedLength(); + if (l == 0) + break; if ((m_findFlags & Find::IFindSupport::FindWholeWords) && ((idx && text.at(idx-1).isLetterOrNumber()) || (idx + l < text.length() && text.at(idx + l).isLetterOrNumber()))) -- GitLab