From f59777b0b35e44179a513d118988cb6677bc7791 Mon Sep 17 00:00:00 2001 From: Randy Fellmy Date: Thu, 3 Apr 2025 13:07:10 -0700 Subject: [PATCH] Fix a hanging issue on regexp The hanging issue is introduced by https://github.com/notepad-plus-plus/notepad-plus-plus/commit/a52738c1ddaad15fcc56c144402bda5139c13373. Close #16371 --- boostregex/BoostRegExSearch.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boostregex/BoostRegExSearch.cxx b/boostregex/BoostRegExSearch.cxx index dc3125f67..ca1f1c734 100644 --- a/boostregex/BoostRegExSearch.cxx +++ b/boostregex/BoostRegExSearch.cxx @@ -437,7 +437,7 @@ Sci::Position BoostRegexSearch::SearchParameters::nextCharacter(Sci::Position po if (_skip_windows_line_end_as_one_character && _document->CharAt(position) == '\r' && _document->CharAt(position+1) == '\n') return position + 2; else - return _document->NextPosition(position, 1); + return std::max(_document->NextPosition(position, 1), position + 1); } bool BoostRegexSearch::SearchParameters::isLineStart(Sci::Position position) const