diff options
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index b218c63ee..18b2bf618 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -625,20 +625,24 @@ ConfigReader::ConfigReader(InspIRCd* Instance, const std::string &filename) : Se this->error = CONF_FILE_NOT_FOUND; }; -std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, int index, bool allow_linefeeds) + +std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, const std::string &default_value, int index, bool allow_linefeeds) { /* Don't need to strlcpy() tag and name anymore, ReadConf() takes const char* */ std::string result; - if (!ServerInstance->Config->ConfValue(*this->data, tag, name, index, result, allow_linefeeds)) + if (!ServerInstance->Config->ConfValue(*this->data, tag, name, default_value, index, result, allow_linefeeds)) { this->error = CONF_VALUE_NOT_FOUND; - return ""; } - return result; } +std::string ConfigReader::ReadValue(const std::string &tag, const std::string &name, int index, bool allow_linefeeds) +{ + return ReadValue(tag, name, "", index, allow_linefeeds); +} + bool ConfigReader::ReadFlag(const std::string &tag, const std::string &name, int index) { return ServerInstance->Config->ConfValueBool(*this->data, tag, name, index); |