summaryrefslogtreecommitdiff
path: root/src/modules/m_helpop.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-12-26 11:28:22 +0000
committerPeter Powell <petpow@saberuk.com>2013-12-27 15:25:42 +0000
commit43babe5c3eb1883c28c6c4d1a88c1bfa0f957ce8 (patch)
treef1abb8b2a47970b0de6104be02e9e7255ab28c68 /src/modules/m_helpop.cpp
parent928c5e6bed419adb1aa489c91857c4eca42ccdcc (diff)
Fix the HELPOP database being destroyed when a rehash fails.
Diffstat (limited to 'src/modules/m_helpop.cpp')
-rw-r--r--src/modules/m_helpop.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index 92abcd76f..4bbe8785e 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -99,7 +99,6 @@ class CommandHelpop : public Command
class ModuleHelpop : public Module
{
private:
- std::string h_file;
CommandHelpop cmd;
Helpop ho;
@@ -120,7 +119,7 @@ class ModuleHelpop : public Module
void ReadConfig()
{
- helpop_map.clear();
+ std::map<irc::string, std::string> help;
ConfigTagList tags = ServerInstance->Config->ConfTags("helpop");
for(ConfigIter i = tags.first; i != tags.second; ++i)
@@ -135,20 +134,21 @@ class ModuleHelpop : public Module
throw ModuleException("m_helpop: The key 'index' is reserved for internal purposes. Please remove it.");
}
- helpop_map[key] = value;
+ help[key] = value;
}
- if (helpop_map.find("start") == helpop_map.end())
+ if (help.find("start") == help.end())
{
// error!
throw ModuleException("m_helpop: Helpop file is missing important entry 'start'. Please check the example conf.");
}
- else if (helpop_map.find("nohelp") == helpop_map.end())
+ else if (help.find("nohelp") == help.end())
{
// error!
throw ModuleException("m_helpop: Helpop file is missing important entry 'nohelp'. Please check the example conf.");
}
+ helpop_map.swap(help);
}
void OnRehash(User* user)