X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigparser.cpp;h=60770d16d9c8f9b735679fc02747fdc3adc96740;hb=3a921efb0bd049eb8cccfcc205ebb260c78b423a;hp=51b2481338cdb5c31011ef26d6b7e90524432016;hpb=f3c6c6123da841537b10598e766e1b61a7e66b54;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configparser.cpp b/src/configparser.cpp index 51b248133..60770d16d 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -367,13 +367,8 @@ 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()); - for (unsigned int t = 0; t < reading.size(); t++) - { - if (path == reading[t]) - { - throw CoreException((isexec ? "Executable " : "File ") + path + " is included recursively (looped inclusion)"); - } - } + if (std::find(reading.begin(), reading.end(), path) != reading.end()) + 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 */