aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-06-17 17:42:00 +0100
committerGravatar Sadie Powell2024-06-17 17:46:18 +0100
commitb202db6cac6b1bf78d00cfa32eef78ed7e3fea0b (patch)
treeed5eac3bd823d48424fe9e2440d98cf0ea77ed5a
parentMake filenames a bit more friendly for Windows users. (diff)
Remove a now unnecessary hack for Windows filenames.
-rw-r--r--src/inspircd.cpp23
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);