From b202db6cac6b1bf78d00cfa32eef78ed7e3fea0b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 17 Jun 2024 17:42:00 +0100 Subject: Remove a now unnecessary hack for Windows filenames. --- src/inspircd.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/inspircd.cpp') 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); -- cgit v1.3.1-10-gc9f91