diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-01 18:34:19 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-01 18:34:19 +0000 |
commit | f505e1821bf0b6e3c36df4bab8e3a4f3d1710dfd (patch) | |
tree | 7aada963984af8f5c44ef4cede2d2e14a2ec662c /src/configreader.cpp | |
parent | 6c6d83a21718b342c4f615dcca4093d06638f9fb (diff) |
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
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r-- | src/configreader.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; |