]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configparser.cpp
Merge pull request #1106 from SaberUK/master+purge-pkg-path
[user/henk/code/inspircd.git] / src / configparser.cpp
index 60770d16d9c8f9b735679fc02747fdc3adc96740..3be1ac9c53d39ce44f0a79dcd6d81defa55735f9 100644 (file)
@@ -155,7 +155,7 @@ struct Parser
                                }
                                else
                                {
-                                       std::map<std::string, std::string>::iterator var = stack.vars.find(varname);
+                                       insp::flat_map<std::string, std::string>::iterator var = stack.vars.find(varname);
                                        if (var == stack.vars.end())
                                                throw CoreException("Undefined XML entity reference '&" + varname + ";'");
                                        value.append(var->second);
@@ -367,7 +367,7 @@ void ParseStack::DoReadFile(const std::string& key, const std::string& name, int
 bool ParseStack::ParseFile(const std::string& path, int flags, const std::string& mandatory_tag, bool isexec)
 {
        ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Reading (isexec=%d) %s", isexec, path.c_str());
-       if (std::find(reading.begin(), reading.end(), path) != reading.end())
+       if (stdalgo::isin(reading, path))
                throw CoreException((isexec ? "Executable " : "File ") + path + " is included recursively (looped inclusion)");
 
        /* It's not already included, add it to the list of files we've loaded */
@@ -385,8 +385,6 @@ bool ParseStack::ParseFile(const std::string& path, int flags, const std::string
 
 bool ConfigTag::readString(const std::string& key, std::string& value, bool allow_lf)
 {
-       if (!this)
-               return false;
        for(std::vector<KeyVal>::iterator j = items.begin(); j != items.end(); ++j)
        {
                if(j->first != key)