]> git.lyx.org Git - lyx.git/commitdiff
Add missing adjustment of end_pos if given length exceeds last pos
authorStephan Witt <switt@lyx.org>
Fri, 9 Oct 2015 06:14:18 +0000 (08:14 +0200)
committerStephan Witt <switt@lyx.org>
Fri, 9 Oct 2015 06:16:23 +0000 (08:16 +0200)
src/lyxfind.cpp

index 0a788c7ba85e6cf204cd8d71bda095db5f45b6da..2cd05ea4a75759a89c052c8c697d1099223d9479 100644 (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)))