X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_regex_stdlib.cpp;h=0e9021d84eff0da7a2485a28034519344c0b1090;hb=772f7ceb94242a8ebfadd0d4e31209c0b51c2923;hp=418237dd1aa901c229c91143d7d851e18bef023a;hpb=aa692dc1039b63deef7886e914ec499abe7facaf;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 418237dd1..0e9021d84 100644 --- a/src/modules/extra/m_regex_stdlib.cpp +++ b/src/modules/extra/m_regex_stdlib.cpp @@ -2,7 +2,7 @@ * InspIRCd -- Internet Relay Chat Daemon * * Copyright (C) 2019 Robby - * Copyright (C) 2013, 2016, 2018 Sadie Powell + * Copyright (C) 2013, 2016, 2018, 2020-2021 Sadie Powell * Copyright (C) 2013 Attila Molnar * Copyright (C) 2012 ChrisTX * @@ -33,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()); } @@ -69,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"))