Testcase without this patch:
1.) open de/Additional.lyx
2.) goto 6.1 Astronomy & Astrophysics
3.) open the index
4.) find advaced
a.) not ignoring format
b.) regex = .+
c.) language of regex: English
4.) search next
The seach finds the next break (which is outside of the index)
The following try to display the selection leads to crash
// Compute the match length
int len = 1;
+ if (cur.pos() + len > cur.lastpos())
+ return 0;
if (match.opt.matchword) {
- if (cur.pos() + len > cur.lastpos())
- return 0;
LYXERR(Debug::FIND, "verifying unmatch with len = " << len);
while (cur.pos() + len <= cur.lastpos() && match(cur, len) <= 0) {
++len;