X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigparser.cpp;h=3be1ac9c53d39ce44f0a79dcd6d81defa55735f9;hb=63aa8d0d42f619c52d382bde3e6ba2e5e23b12ac;hp=60770d16d9c8f9b735679fc02747fdc3adc96740;hpb=f62654a6859998f9d63eb22702c572d5ebcff15c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configparser.cpp b/src/configparser.cpp index 60770d16d..3be1ac9c5 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -155,7 +155,7 @@ struct Parser } else { - std::map::iterator var = stack.vars.find(varname); + insp::flat_map::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::iterator j = items.begin(); j != items.end(); ++j) { if(j->first != key)