]> git.lyx.org Git - features.git/commitdiff
findadv: avoid crash when regexp-based search fails (mitigates #10625).
authorTommaso Cucinotta <tommaso@lyx.org>
Sun, 16 Apr 2017 09:27:34 +0000 (11:27 +0200)
committerTommaso Cucinotta <tommaso@lyx.org>
Sun, 16 Apr 2017 09:27:34 +0000 (11:27 +0200)
src/lyxfind.cpp

index bb4e985a547b2e8829153d2de40b9901cdfbaadc..9e79d78dbe077fae7bf1a64ecb9d0210a5f75e6f 100644 (file)
@@ -961,6 +961,8 @@ int MatchStringAdv::findAux(DocIterator const & cur, int len, bool at_begin) con
                LYXERR(Debug::FIND, "Searching in regexp mode: at_begin=" << at_begin);
                regex const & p_regexp = at_begin ? regexp : regexp2;
                sregex_iterator re_it(str.begin(), str.end(), p_regexp);
+               if (re_it == std::sregex_iterator())
+                       return 0;
                match_results<string::const_iterator> const & m = *re_it;
 
                // Check braces on the segment that matched the entire regexp expression,