summaryrefslogtreecommitdiff
path: root/ledger.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ledger.cc')
-rw-r--r--ledger.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/ledger.cc b/ledger.cc
index 1b354f12..548d51c5 100644
--- a/ledger.cc
+++ b/ledger.cc
@@ -212,7 +212,8 @@ void read_regexps(const char * path, std::list<mask>& regexps)
}
}
-bool matches(const std::list<mask>& regexps, const std::string& str)
+bool matches(const std::list<mask>& regexps, const std::string& str,
+ bool * exclude)
{
// If the first pattern is an exclude, we assume all patterns match
// if they don't match the exclude. If the first pattern is an
@@ -225,8 +226,11 @@ bool matches(const std::list<mask>& regexps, const std::string& str)
r++) {
int ovec[3];
if (pcre_exec((*r).regexp, NULL, str.c_str(), str.length(),
- 0, 0, ovec, 3) >= 0)
+ 0, 0, ovec, 3) >= 0) {
+ if (exclude)
+ *exclude = (*r).exclude;
match = ! (*r).exclude;
+ }
}
return match;