mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Fix directory includes to always be in a consistent order.
This commit is contained in:
parent
be8f97b4a5
commit
0e18b9daaf
@ -389,6 +389,7 @@ void ParseStack::DoInclude(const std::shared_ptr<ConfigTag>& tag, int flags)
|
||||
flags |= FLAG_NO_ENV;
|
||||
|
||||
const std::string includedir = ServerInstance->Config->Paths.PrependConfig(name);
|
||||
std::set<std::string> configs;
|
||||
try
|
||||
{
|
||||
for (const auto& entry : std::filesystem::directory_iterator(includedir))
|
||||
@ -397,17 +398,20 @@ void ParseStack::DoInclude(const std::shared_ptr<ConfigTag>& tag, int flags)
|
||||
continue;
|
||||
|
||||
const std::string path = entry.path().string();
|
||||
if (!InspIRCd::Match(path, "*.conf"))
|
||||
continue;
|
||||
|
||||
if (!ParseFile(path, flags, mandatorytag))
|
||||
throw CoreException("Included");
|
||||
if (InspIRCd::Match(path, "*.conf"))
|
||||
configs.insert(path);
|
||||
}
|
||||
}
|
||||
catch (const std::filesystem::filesystem_error& err)
|
||||
{
|
||||
throw CoreException("Unable to read directory for include " + includedir + ": " + err.what());
|
||||
}
|
||||
|
||||
for (const auto& config : configs)
|
||||
{
|
||||
if (!ParseFile(config, flags, mandatorytag))
|
||||
throw CoreException("Included");
|
||||
}
|
||||
}
|
||||
|
||||
else if (tag->readString("executable", name))
|
||||
|
Loading…
x
Reference in New Issue
Block a user