Skip to content

Commit d0e0002

Browse files
committed
Fix the regression tests as reported on #1142
1 parent 3062ff2 commit d0e0002

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/operators/contains.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool Contains::evaluate(Transaction *transaction, const std::string &input) {
2626
std::string p = MacroExpansion::expand(param, transaction);
2727
bool contains = input.find(p) != std::string::npos;
2828

29-
if (contains) {
29+
if (contains && transaction) {
3030
transaction->m_matched.push_back(p);
3131
}
3232

src/operators/pm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ bool Pm::evaluate(Transaction *transaction, const std::string &input) {
7777
const char *match = NULL;
7878

7979
rc = acmp_process_quick(&pt, &match, input.c_str(), input.length());
80-
if (rc == 1) {
80+
if (rc == 1 && transaction) {
8181
transaction->m_matched.push_back(std::string(match));
8282
}
8383

src/operators/rx.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ namespace operators {
2929
bool Rx::evaluate(Transaction *transaction, const std::string& input) {
3030
SMatch match;
3131

32+
if (m_param.empty()) {
33+
return true;
34+
}
35+
3236
if (regex_search(input, &match, *m_re) && match.size() >= 1) {
33-
transaction->m_matched.push_back(match.match);
37+
if (transaction) {
38+
transaction->m_matched.push_back(match.match);
39+
}
3440
return true;
3541
}
3642

0 commit comments

Comments
 (0)