X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_regex_pcre.cpp;h=9ae6719ba96a89d35adc9d67ca7d5c5f7bd6932f;hb=3323226c38c959392e61f406ec62f9d5f24fce15;hp=01cf4717824c3267a07bd4413f8d0f61fd8abb6f;hpb=0e7f74a7c8e804a0223b4d88bf637649838f0412;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_regex_pcre.cpp b/src/modules/extra/m_regex_pcre.cpp index 01cf47178..9ae6719ba 100644 --- a/src/modules/extra/m_regex_pcre.cpp +++ b/src/modules/extra/m_regex_pcre.cpp @@ -51,14 +51,9 @@ class PCRERegex : public Regex pcre_free(regex); } - bool Matches(const std::string& text) + bool Matches(const std::string& text) CXX11_OVERRIDE { - if (pcre_exec(regex, NULL, text.c_str(), text.length(), 0, 0, NULL, 0) > -1) - { - // Bang. :D - return true; - } - return false; + return (pcre_exec(regex, NULL, text.c_str(), text.length(), 0, 0, NULL, 0) >= 0); } }; @@ -66,7 +61,7 @@ class PCREFactory : public RegexFactory { public: PCREFactory(Module* m) : RegexFactory(m, "regex/pcre") {} - Regex* Create(const std::string& expr) + Regex* Create(const std::string& expr) CXX11_OVERRIDE { return new PCRERegex(expr); } @@ -78,7 +73,6 @@ class ModuleRegexPCRE : public Module PCREFactory ref; ModuleRegexPCRE() : ref(this) { - ServerInstance->Modules->AddService(ref); } Version GetVersion() CXX11_OVERRIDE