Hi,

I just recovered all working regexp rest-cases, both with std::regex and with 
boost::regex.
A bit of worklog can be found at #10625.

The needed further changes in lyxfind.cpp (in addition to the crash fix) have 
been pushed, along
with a few fixes to tests themselves (key shortcuts no more matching, regexps 
relying on boost::
dialect, some further cases to consider in the lyxfind.cpp regex-mangling 
machinery).

Pushed patches:
[lyxgit/4f750261]
[lyxgit/6d05a965]
[lyxgit/9824926b]
[lyxgit/66479812]
[lyxgit/ecc36be6]
[lyxgit/a1024781]

I'd be happy to hear from others recompiling on different platforms than Linux 
Ubuntu and playing
a bit with that.

Thanks & Happy Easter to everyone :-)!!!

        T.

ps: in case you're curious, I didn't go through the manual to check that all 
documented cases
    still work, nor did I check all the related bugs on Trac -- not yet.

On 16/04/2017 17:23, Kornel Benko wrote:
Am Sonntag, 16. April 2017 um 11:29:19, schrieb Tommaso Cucinotta 
<tomm...@lyx.org>
commit ecc36be60baba3b3b093f4b9b8454bf11b2fb2f9
Author: Tommaso Cucinotta <tomm...@lyx.org>
Date:   Sun Apr 16 11:27:34 2017 +0200

    findadv: avoid crash when regexp-based search fails (mitigates #10625).
---
 src/lyxfind.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index bb4e985..9e79d78 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -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,

I got here
        /usr2/src/lyx/lyx-git/src/lyxfind.cpp: In member function ‘int 
lyx::{anonymous}::MatchStringAdv::findAux(const lyx::DocIterator&, int, bool) 
const’:
/usr2/src/lyx/lyx-git/src/lyxfind.cpp:964:16: error: ‘sregex_iterator’ is not a 
member of ‘std’
   if (re_it == std::sregex_iterator())
                ^~~
/usr2/src/lyx/lyx-git/src/lyxfind.cpp:964:16: note: suggested alternatives:
In file included from 
/usr2/src/lyx/lyx-git/3rdparty/boost/boost/regex/v4/regex.hpp:151:0,
                 from /usr2/src/lyx/lyx-git/3rdparty/boost/boost/regex.hpp:31,
                 from /usr2/src/lyx/lyx-git/src/support/regex.h:21,
                 from /usr2/src/lyx/lyx-git/src/lyxfind.cpp:54:

        Kornel


Reply via email to