summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-06-25 12:56:14 +0100
committerPeter Powell <petpow@saberuk.com>2018-06-25 13:06:40 +0100
commit765abf3a41551590219bc8bd4be80b3ff6ba6053 (patch)
treea131ced254aa1406f4696ae5ac0600f8b19b5049 /src
parent2241991dda01f114e25a4b0c7dcdf48b1826780b (diff)
Allow relative paths to be passed in --config on boot.
Closes #1115.
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp11
1 files changed, 10 insertions, 1 deletions
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 */