summaryrefslogtreecommitdiff
path: root/mask.cc
diff options
context:
space:
mode:
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