X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_regex_stdlib.cpp;h=0e9021d84eff0da7a2485a28034519344c0b1090;hb=772f7ceb94242a8ebfadd0d4e31209c0b51c2923;hp=14796c22f861469f86eab438a75c409292904a9e;hpb=e57d1b19ff4823b7885eb7f4d3b37c84d2edca0e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_regex_stdlib.cpp b/src/modules/extra/m_regex_stdlib.cpp index 14796c22f..0e9021d84 100644 --- a/src/modules/extra/m_regex_stdlib.cpp +++ b/src/modules/extra/m_regex_stdlib.cpp @@ -1,7 +1,10 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2012 ChrisTX + * Copyright (C) 2019 Robby + * Copyright (C) 2013, 2016, 2018, 2020-2021 Sadie Powell + * Copyright (C) 2013 Attila Molnar + * Copyright (C) 2012 ChrisTX * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -30,10 +33,11 @@ class StdRegex : public Regex public: StdRegex(const std::string& rx, std::regex::flag_type fltype) : Regex(rx) { - try{ + try + { regexcl.assign(rx, fltype | std::regex::optimize); } - catch(std::regex_error rxerr) + catch(const std::regex_error& rxerr) { throw RegexException(rx, rxerr.what()); } @@ -66,14 +70,14 @@ public: Version GetVersion() CXX11_OVERRIDE { - return Version("Regex Provider Module for std::regex", VF_VENDOR); + return Version("Provides the stdregex regular expression engine which uses the C++11 std::regex regular expression matching system.", VF_VENDOR); } void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* Conf = ServerInstance->Config->ConfValue("stdregex"); - std::string regextype = Conf->getString("type", "ecmascript"); + const std::string regextype = Conf->getString("type", "ecmascript", 1); if (stdalgo::string::equalsci(regextype, "bre")) ref.regextype = std::regex::basic; else if (stdalgo::string::equalsci(regextype, "ere"))