From 765abf3a41551590219bc8bd4be80b3ff6ba6053 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 25 Jun 2018 12:56:14 +0100 Subject: Allow relative paths to be passed in --config on boot. Closes #1115. --- src/inspircd.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index ab5a9e191..8ebdc3b58 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -294,7 +294,16 @@ InspIRCd::InspIRCd(int argc, char** argv) : { case 'c': /* Config filename was set */ - ConfigFileName = ServerInstance->Config->Paths.PrependConfig(optarg); + ConfigFileName = optarg; +#ifdef _WIN32 + TCHAR configPath[MAX_PATH + 1]; + if (GetFullPathName(optarg, MAX_PATH, configPath, NULL) > 0) + ConfigFileName = configPath; +#else + char configPath[PATH_MAX + 1]; + if (realpath(optarg, configPath)) + ConfigFileName = configPath; +#endif break; case 0: /* getopt_long_only() set an int variable, just keep going */ -- cgit v1.2.3