summaryrefslogtreecommitdiff
path: root/mask.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-04-13 03:35:00 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:35:00 -0400
commit42f43b7686038e4cbca16d8d2118b139544e6de3 (patch)
tree52c5473401c57282242d66b8dd75f4c07bf41d07 /mask.cc
parentc7b4370ff9c8ab5c96f15b1e712e6db6bdab6324 (diff)
downloadfork-ledger-42f43b7686038e4cbca16d8d2118b139544e6de3.tar.gz
fork-ledger-42f43b7686038e4cbca16d8d2118b139544e6de3.tar.bz2
fork-ledger-42f43b7686038e4cbca16d8d2118b139544e6de3.zip
Check in all changes made so far toward 3.0.
Diffstat (limited to 'mask.cc')
-rw-r--r--mask.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/mask.cc b/mask.cc
index 972b24ce..7a7a1fc3 100644
--- a/mask.cc
+++ b/mask.cc
@@ -1,3 +1,6 @@
+#ifdef USE_PCH
+#include "pch.h"
+#else
#include "mask.h"
#include "debug.h"
#include "util.h"
@@ -5,9 +8,12 @@
#include <cstdlib>
#include <pcre.h>
+#endif
mask_t::mask_t(const std::string& pat) : exclude(false)
{
+ TRACE_CTOR("mask_t(const std::string&)");
+
const char * p = pat.c_str();
if (*p == '-') {
exclude = true;
@@ -33,6 +39,8 @@ mask_t::mask_t(const std::string& pat) : exclude(false)
mask_t::mask_t(const mask_t& m) : exclude(m.exclude), pattern(m.pattern)
{
+ TRACE_CTOR("mask_t(copy)");
+
const char *error;
int erroffset;
regexp = pcre_compile(pattern.c_str(), PCRE_CASELESS,
@@ -41,7 +49,9 @@ mask_t::mask_t(const mask_t& m) : exclude(m.exclude), pattern(m.pattern)
}
mask_t::~mask_t() {
- pcre_free((pcre *)regexp);
+ TRACE_DTOR("mask_t");
+ if (regexp)
+ pcre_free((pcre *)regexp);
}
bool mask_t::match(const std::string& str) const