commit d5f7ed38fc4c15a0685e48befa03ea5dbc01a3a6
Author: Stephan Witt <[email protected]>
Date: Fri Oct 9 08:14:18 2015 +0200
Add missing adjustment of end_pos if given length exceeds last pos
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 0a788c7..2cd05ea 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)))