aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bbot/worker/worker.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx
index 69a0f28..fae83b9 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -717,6 +717,21 @@ run_cmd (step_id step,
//
if (r != result_status::warning)
{
+ // Match flags.
+ //
+ // Note that by default std::regex_search() matches the empty
+ // substrings in non-empty strings for all the major
+ // implementations (see the butl::regex_replace_search()
+ // function implementation for details). While it's unlikely
+ // that the warning regex will match the empty substrings, let's
+ // keep it consistent with the other regex_search() call sites.
+ //
+ regex_constants::match_flag_type mf (
+ regex_constants::match_default);
+
+ if (!l.empty ())
+ mf |= regex_constants::match_not_null;
+
for (const regex& re: warn_detect)
{
// Only examine the first 512 bytes. Long lines (e.g., linker
@@ -728,7 +743,8 @@ run_cmd (step_id step,
(l.size () < 512
? l.end ()
: l.begin () + 512),
- re))
+ re,
+ mf))
{
r = result_status::warning;
break;