summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_filter_pcre.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index e35094ac0..8a3119f20 100644
--- a/src/modules/extra/m_filter_pcre.cpp
+++ b/src/modules/extra/m_filter_pcre.cpp
@@ -34,6 +34,10 @@ class PCREFilter : public FilterResult
: FilterResult::FilterResult(pat, rea, act, gline_time), regexp(r)
{
}
+
+ PCREFilter()
+ {
+ }
};
class ModuleFilterPCRE : public FilterBase
@@ -42,6 +46,7 @@ class ModuleFilterPCRE : public FilterBase
pcre *re;
const char *error;
int erroffset;
+ PCREFilter fr;
public:
ModuleFilterPCRE(InspIRCd* Me)
@@ -60,14 +65,13 @@ class ModuleFilterPCRE : public FilterBase
{
if (pcre_exec(index->regexp, NULL, text.c_str(), text.length(), 0, 0, NULL, 0) > -1)
{
- PCREFilter* fr = &(*index);
+ fr = *index;
if (index != filters.begin())
{
filters.erase(index);
- filters.insert(filters.begin(), *fr);
- index = filters.begin();
+ filters.insert(filters.begin(), fr);
}
- return &(*index);
+ return &fr;
}
}
return NULL;