mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Do not search for empty string
This commit is contained in:
parent
e8a01d099a
commit
ec078bd29d
@ -1044,7 +1044,7 @@ int iterateLine(string const token, regex const reg, string const closing,
|
|||||||
// result = -1 means we did not find a fragment!
|
// result = -1 means we did not find a fragment!
|
||||||
int result = -1;
|
int result = -1;
|
||||||
int last_match_pos = -1;
|
int last_match_pos = -1;
|
||||||
if (token.find(last_match) != string::npos)
|
if (!last_match.empty() && token.find(last_match) != string::npos)
|
||||||
last_match_pos = int(token.find(last_match));
|
last_match_pos = int(token.find(last_match));
|
||||||
if (fragment) {
|
if (fragment) {
|
||||||
if (last_match_pos > fragment_pos)
|
if (last_match_pos > fragment_pos)
|
||||||
@ -1054,6 +1054,7 @@ int iterateLine(string const token, regex const reg, string const closing,
|
|||||||
} else
|
} else
|
||||||
if (last_match_pos < fragment_pos)
|
if (last_match_pos < fragment_pos)
|
||||||
result = fragment_pos;
|
result = fragment_pos;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user