Add missing adjustment of end_pos if given length exceeds last pos

This commit is contained in:
Stephan Witt 2015-10-09 08:14:18 +02:00
parent 77cc2c7c8c
commit d5f7ed38fc

View File

@ -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)))