aboutsummaryrefslogtreecommitdiffstats
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 61403cc7a..4b799a62b 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -32,7 +32,14 @@
*/
+#include <filesystem>
+#include <fstream>
+#include <iostream>
+
#include "inspircd.h"
+#include "exitcodes.h"
+#include "xline.h"
+
#include <signal.h>
#ifndef _WIN32
@@ -49,11 +56,6 @@
WindowsStream StandardOutput(STD_OUTPUT_HANDLE);
#endif
-#include <fstream>
-#include <iostream>
-#include "xline.h"
-#include "exitcodes.h"
-
InspIRCd* ServerInstance = NULL;
/** Separate from the other casemap tables so that code *can* still exclusively rely on RFC casemapping
@@ -204,14 +206,15 @@ namespace
// Locates a config file on the file system.
bool FindConfigFile(std::string& path)
{
- if (FileSystem::FileExists(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 (FileSystem::FileExists(txtpath))
+ if (std::filesystem::is_regular_file(txtpath, ec))
{
path.assign(txtpath);
return true;