X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.cpp;h=e7c8cf66c317967c74d7ef39dfa3284c59482cb4;hb=421853d1bf021b7180a61d8c2908ede2dce48061;hp=f8ce18d3ec09fd0c53e573a967859e35af7c6c8e;hpb=81e592603d1c87ecd993ba3f1e7f6498d12e919f;p=lyx.git diff --git a/src/insets/ExternalTransforms.cpp b/src/insets/ExternalTransforms.cpp index f8ce18d3ec..e7c8cf66c3 100644 --- a/src/insets/ExternalTransforms.cpp +++ b/src/insets/ExternalTransforms.cpp @@ -283,7 +283,7 @@ string const sanitizeLatexOption(string const & input) // "[,,,,foo..." -> "foo..." ("foo..." may be empty) string output; lyx::smatch what; - static lyx::regex const front("^( *[[],*)(.*)$"); + static lyx::regex const front("^( *\\[,*)(.*)$"); regex_match(it, end, what, front); if (!what[0].matched) { @@ -309,7 +309,9 @@ string const sanitizeLatexOption(string const & input) // Strip any trailing commas // "...foo,,,]" -> "...foo" ("...foo,,," may be empty) - static lyx::regex const back("^(.*[^,])?,*[]] *$"); + static lyx::regex const back("^(.*[^,])?,*\\] *$"); + // false positive from coverity + // coverity[CHECKED_RETURN] regex_match(output, what, back); if (!what[0].matched) { lyxerr << "Unable to sanitize LaTeX \"Option\": " @@ -336,7 +338,7 @@ void extractIt(boost::any const & any_factory, return; Factory factory = boost::any_cast(any_factory); - if (!factory.empty()) + if (factory) transformer = factory(data); }