From d5f7ed38fc4c15a0685e48befa03ea5dbc01a3a6 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Fri, 9 Oct 2015 08:14:18 +0200 Subject: [PATCH] Add missing adjustment of end_pos if given length exceeds last pos --- src/lyxfind.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 0a788c7ba8..2cd05ea4a7 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1299,6 +1299,7 @@ static bool allNonLowercase(Cursor const & cur, int len) if (len > cur.lastpos() + 1 - beg_pos) { LYXERR(Debug::FIND, "This should not happen, more debug needed"); len = cur.lastpos() + 1 - beg_pos; + end_pos = beg_pos + len; } for (pos_type pos = beg_pos; pos != end_pos; ++pos) if (isLowerCase(cur.paragraph().getChar(pos))) -- 2.39.2