diff options
| author | 2024-06-17 20:29:46 +0100 | |
|---|---|---|
| committer | 2024-06-17 20:29:46 +0100 | |
| commit | d576ed96df849892a82f38230af58bffb6afabe5 (patch) | |
| tree | 1643cb235bb7c5efc0398fe19cdcf4ca2649ce9c /src/configparser.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
| parent | Update a few mailmap entries. (diff) | |
Merge branch 'insp4' into master.
Diffstat (limited to 'src/configparser.cpp')
| -rw-r--r-- | src/configparser.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index ec970b581..d746a6e5c 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -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)) |
