diff options
author | Adam <Adam@anope.org> | 2013-05-05 20:38:57 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-05 20:38:57 -0400 |
commit | 3e8752fe665c3cdf683f2b5fa271231fb3a624df (patch) | |
tree | aa2f2c15d96bf86966abec603ca47b80e80120c2 /src/config.cpp | |
parent | 57c2b65f08c9c0658003a74a32c6506829e12b0b (diff) |
The default arguments are references to temporaries which fall out of scope once the function returns, so we can't use them. gcc is just nice. cronus sucks. also validate a few more config options
Diffstat (limited to 'src/config.cpp')
-rw-r--r-- | src/config.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/config.cpp b/src/config.cpp index 96ed47917..f937b7930 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -79,14 +79,20 @@ const Block::item_map* Block::GetItems() const template<> const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const { + static Anope::string ret; + if (!this) - return def; + { + ret = def; + return ret; + } Anope::map<Anope::string>::const_iterator it = items.find(tag); if (it != items.end()) return it->second; - return def; + ret = def; + return ret; } template<> time_t Block::Get(const Anope::string &tag, const Anope::string &def) const @@ -166,9 +172,16 @@ Conf::Conf() : Block("") Block *options = this->GetBlock("options"), *mail = this->GetBlock("mail"); ValidateNotZero("options", "releasetimeout", options->Get<time_t>("releasetimeout")); + ValidateNotZero("options", "updatetimeout", options->Get<time_t>("updatetimeout")); + ValidateNotZero("options", "expiretimeout", options->Get<time_t>("expiretimeout")); + ValidateNotZero("options", "readtimeout", options->Get<time_t>("readtimeout")); + ValidateNotZero("options", "warningtimeout", options->Get<time_t>("warningtimeout")); + ValidateNotZero("options", "timeoutcheck", options->Get<time_t>("timeoutcheck")); + ValidateNotEmpty("options", "enforceruser", options->Get<const Anope::string &>("enforceruser")); ValidateNotEmpty("options", "enforcerhost", options->Get<const Anope::string &>("enforcerhost")); ValidateNotEmpty("options", "guestnickprefix", options->Get<const Anope::string &>("guestnickprefix")); + spacesepstream(options->Get<const Anope::string &>("ulineservers")).GetTokens(this->Ulines); if (mail->Get<bool>("usemail")) |