From f505e1821bf0b6e3c36df4bab8e3a4f3d1710dfd Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 1 Apr 2007 18:34:19 +0000 Subject: Add -config parameter to bin/inspircd which allows a user to specify the config file on the commandline Note: This should really be a full pathname, and not a configuration file in the current directory. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6726 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/configreader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 315c1eb08..26e9634d1 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -682,7 +682,7 @@ void ServerConfig::Read(bool bail, userrec* user) /* Make a copy here so if it fails then we can carry on running with an unaffected config */ ConfigDataHash newconfig; - if (this->LoadConf(newconfig, CONFIG_FILE, errstr)) + if (this->LoadConf(newconfig, ServerInstance->ConfigFileName, errstr)) { /* If we succeeded, set the ircd config to the new one */ this->config_data = newconfig; @@ -1211,7 +1211,7 @@ bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, st std::string newfile; std::string::size_type pos; - confpath = CONFIG_FILE; + confpath = ServerInstance->ConfigFileName; newfile = file; for (std::string::iterator c = newfile.begin(); c != newfile.end(); c++) @@ -1224,7 +1224,7 @@ bool ServerConfig::DoInclude(ConfigDataHash &target, const std::string &file, st if (file[0] != '/') { - if((pos = confpath.find("/inspircd.conf")) != std::string::npos) + if((pos = confpath.rfind("/")) != std::string::npos) { /* Leaves us with just the path */ newfile = confpath.substr(0, pos) + std::string("/") + newfile; @@ -1436,8 +1436,8 @@ bool ServerConfig::ReadFile(file_cache &F, const char* fname) if (*fname != '/') { std::string::size_type pos; - std::string confpath = CONFIG_FILE; - if((pos = confpath.find("/inspircd.conf")) != std::string::npos) + std::string confpath = ServerInstance->ConfigFileName; + if((pos = confpath.rfind("/")) != std::string::npos) { /* Leaves us with just the path */ std::string newfile = confpath.substr(0, pos) + std::string("/") + fname; -- cgit v1.3.1-10-gc9f91