]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_helpop.cpp
Merge insp20
[user/henk/code/inspircd.git] / src / modules / m_helpop.cpp
index 64bdc2400c6410a99d665c24d545c7b1de5f9cb6..2fe958a71c2c96fa4c7bc71be7e0741a4c667c48 100644 (file)
@@ -96,7 +96,6 @@ class CommandHelpop : public Command
 
 class ModuleHelpop : public Module
 {
-               std::string  h_file;
                CommandHelpop cmd;
                Helpop ho;
 
@@ -108,7 +107,7 @@ class ModuleHelpop : public Module
 
                void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
                {
-                       helpop_map.clear();
+                       HelpopMap help;
 
                        ConfigTagList tags = ServerInstance->Config->ConfTags("helpop");
                        for(ConfigIter i = tags.first; i != tags.second; ++i)
@@ -123,20 +122,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 OnWhois(User* src, User* dst) CXX11_OVERRIDE