diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-24 01:44:29 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-24 01:44:29 +0000 |
commit | c8026bc2d73344e1df526f0a80694046efa4b22a (patch) | |
tree | 539e3bca92733aeff631fad70ecc6722550ef0b0 /src/inspircd.cpp | |
parent | 58895f9b1daa1e13927462d046a36dec853a40e0 (diff) |
Move configuration filename specification to start script, to reduce hardcoded paths in executable
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11759 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 704fec475..f28324d16 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -328,6 +328,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : HandleIsChannel(this), HandleIsSID(this), HandleRehash(this), + ConfigFileName("inspircd.conf"), /* Functor pointer initialisation. Must match the order of the list above * @@ -428,7 +429,6 @@ InspIRCd::InspIRCd(int argc, char** argv) : srand(this->TIME); *this->LogFileName = 0; - strlcpy(this->ConfigFileName, CONFIG_FILE, MAXBUF); struct option longopts[] = { @@ -454,7 +454,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : break; case 'c': /* Config filename was set */ - strlcpy(ConfigFileName, optarg, MAXBUF); + ConfigFileName = optarg; break; case 0: /* getopt_long_only() set an int variable, just keep going */ @@ -508,7 +508,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : Exit(EXIT_STATUS_LOG); } - if (!ServerConfig::FileExists(this->ConfigFileName)) + if (!ServerConfig::FileExists(ConfigFileName.c_str())) { #ifdef WIN32 /* Windows can (and defaults to) hide file extensions, so let's play a bit nice for windows users. */ @@ -517,13 +517,13 @@ InspIRCd::InspIRCd(int argc, char** argv) : if (ServerConfig::FileExists(txtconf.c_str())) { - strlcat(this->ConfigFileName, ".txt", MAXBUF); + ConfigFileName = txtconf; } else #endif { - printf("ERROR: Cannot open config file: %s\nExiting...\n", this->ConfigFileName); - this->Logs->Log("STARTUP",DEFAULT,"Unable to open config file %s", this->ConfigFileName); + printf("ERROR: Cannot open config file: %s\nExiting...\n", ConfigFileName.c_str()); + this->Logs->Log("STARTUP",DEFAULT,"Unable to open config file %s", ConfigFileName.c_str()); Exit(EXIT_STATUS_CONFIG); } } |