X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fextra%2Fm_regex_posix.cpp;h=d63b83acf1d1fe31e2954228f2b6fd175a679932;hb=a1db12cb2e7024981291cbd7e51b73c9a684d76c;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..d63b83acf 100644 --- a/src/modules/extra/m_regex_posix.cpp +++ b/src/modules/extra/m_regex_posix.cpp @@ -1,7 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2013 Sadie Powell + * Copyright (C) 2012-2013 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2009-2010 Daniel De Graaf + * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2008 Thomas Stagner * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -54,14 +58,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 +69,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,16 +82,14 @@ class ModuleRegexPOSIX : public Module public: ModuleRegexPOSIX() : ref(this) { - ServerInstance->Modules->AddService(ref); - OnRehash(NULL); } Version GetVersion() CXX11_OVERRIDE { - return Version("Regex Provider Module for POSIX Regular Expressions", VF_VENDOR); + return Version("Provides the posix regular expression engine which uses the POSIX.2 regular expression matching system.", VF_VENDOR); } - void OnRehash(User* u) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ref.extended = ServerInstance->Config->ConfValue("posix")->getBool("extended"); }