Le 12/09/15 18:48, Jean-Marc Lasgouttes a écrit :
Le 12/09/15 18:43, Jean-Marc a écrit :
commit 61f02710317b99a050346a0c95c02fcdd457bfca
Author: Jean-Marc <lasgout...@lyx.org>
Date: Sat Sep 12 18:40:52 2015 +0200
Add missing braces
Coverity issue 23506.
This is an example of a bug found by coverity amidst lots of nit
picking. However doing the boring part is important since it allows to
make the important part visible.
Another example from lyxfinc.cpp. Can you spot what is wrong with the
loop? I cannot fix that myself unfortunately. Tommaso?
JMarc
915 for (; re_it != re_it_end; ++re_it) {
916 match_results<string::const_iterator> const & m = *re_it;
917 // Check braces on the segment that matched the entire
regexp expression,
918 // plus the last subexpression, if a (.*?) was inserted
in the constructor.
919 if (!braces_match(m[0].first, m[0].second, open_braces))
920 return 0;
921 // Check braces on segments that matched all (.*?)
subexpressions,
922 // except the last "padding" one inserted by lyx.
923 for (size_t i = 1; i < m.size() - 1; ++i)
924 if (!braces_match(m[i].first, m[i].second))
925 return false;
926 // Exclude from the returned match length any length
927 // due to close wildcards added at end of regexp
928 if (close_wildcards == 0)
929 return m[0].second - m[0].first;
930 else
931 return m[m.size() - close_wildcards].first -
m[0].first;
932 }