aboutsummaryrefslogtreecommitdiffstats
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorGravatar Peter Powell2018-06-25 12:56:14 +0100
committerGravatar Peter Powell2018-06-25 13:06:40 +0100
commit765abf3a41551590219bc8bd4be80b3ff6ba6053 (patch)
treea131ced254aa1406f4696ae5ac0600f8b19b5049 /src/inspircd.cpp
parentShow the package name in the message when doing pkg-config lookups. (diff)
downloadinspircd++-765abf3a41551590219bc8bd4be80b3ff6ba6053.tar.gz
inspircd++-765abf3a41551590219bc8bd4be80b3ff6ba6053.tar.bz2
inspircd++-765abf3a41551590219bc8bd4be80b3ff6ba6053.zip
Allow relative paths to be passed in --config on boot.
Closes #1115.
Diffstat (limited to 'src/inspircd.cpp')
-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 */