diff options
| author | 2024-06-17 17:42:00 +0100 | |
|---|---|---|
| committer | 2024-06-17 17:46:18 +0100 | |
| commit | b202db6cac6b1bf78d00cfa32eef78ed7e3fea0b (patch) | |
| tree | ed5eac3bd823d48424fe9e2440d98cf0ea77ed5a /src/inspircd.cpp | |
| parent | Make filenames a bit more friendly for Windows users. (diff) | |
Remove a now unnecessary hack for Windows filenames.
Diffstat (limited to 'src/inspircd.cpp')
| -rw-r--r-- | src/inspircd.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index ae01efd17..bd18deee5 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -199,26 +199,6 @@ namespace return path; } - // Locates a config file on the file system. - bool FindConfigFile(std::string& path) - { - std::error_code ec; - if (std::filesystem::is_regular_file(path, ec)) - return true; - -#ifdef _WIN32 - // Windows hides file extensions by default so try appending .txt to the path - // to help users who have that feature enabled and can't create .conf files. - const std::string txtpath = path + ".txt"; - if (std::filesystem::is_regular_file(txtpath, ec)) - { - path.assign(txtpath); - return true; - } -#endif - return false; - } - // Attempts to fork into the background. void ForkIntoBackground() { @@ -489,7 +469,8 @@ InspIRCd::InspIRCd(int argc, char** argv) if (Config->CommandLine.forcedebug) Logs.EnableDebugMode(); - if (!FindConfigFile(ConfigFileName)) + std::error_code ec; + if (!std::filesystem::is_regular_file(ConfigFileName, ec)) { this->Logs.Critical("STARTUP", "Unable to open config file {}", ConfigFileName); fmt::println("ERROR: Cannot open config file: {}", ConfigFileName); |
