X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_regex_posix.cpp;h=b5fddfab8f2c0e748aa35cb22fcc861bc2eeb90f;hb=acccaa39641500b8a691db4136e6571102a438ed;hp=6c52a935b6724cb65738e6f05c77d86b2762cff8;hpb=0e7f74a7c8e804a0223b4d88bf637649838f0412;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_regex_posix.cpp b/src/modules/extra/m_regex_posix.cpp index 6c52a935b..b5fddfab8 100644 --- a/src/modules/extra/m_regex_posix.cpp +++ b/src/modules/extra/m_regex_posix.cpp @@ -54,14 +54,9 @@ class POSIXRegex : public Regex regfree(®buf); } - bool Matches(const std::string& text) + bool Matches(const std::string& text) CXX11_OVERRIDE { - if (regexec(®buf, text.c_str(), 0, NULL, 0) == 0) - { - // Bang. :D - return true; - } - return false; + return (regexec(®buf, text.c_str(), 0, NULL, 0) == 0); } }; @@ -70,7 +65,7 @@ class PosixFactory : public RegexFactory public: bool extended; PosixFactory(Module* m) : RegexFactory(m, "regex/posix") {} - Regex* Create(const std::string& expr) + Regex* Create(const std::string& expr) CXX11_OVERRIDE { return new POSIXRegex(expr, extended); } @@ -83,8 +78,6 @@ class ModuleRegexPOSIX : public Module public: ModuleRegexPOSIX() : ref(this) { - ServerInstance->Modules->AddService(ref); - OnRehash(NULL); } Version GetVersion() CXX11_OVERRIDE @@ -92,7 +85,7 @@ class ModuleRegexPOSIX : public Module return Version("Regex Provider Module for POSIX Regular Expressions", VF_VENDOR); } - void OnRehash(User* u) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ref.extended = ServerInstance->Config->ConfValue("posix")->getBool("extended"); }