diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-12-08 15:02:08 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-12-08 15:02:08 +0000 |
commit | 04ef4ed9b070e3df040fda478ca80bdccce22e65 (patch) | |
tree | 6a4ba0968d2ac09b4f8ac153c3af2f9dc157f26b /src | |
parent | 4579758c8f9051cf87b5bf06ba12e6125104d0eb (diff) |
If we can't find file.conf, search for file.conf.txt when on windows.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10872 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index ec18728b5..527eb95b0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -521,9 +521,19 @@ InspIRCd::InspIRCd(int argc, char** argv) if (!ServerConfig::FileExists(this->ConfigFileName)) { - printf("ERROR: Cannot open config file: %s\nExiting...\n", this->ConfigFileName); - this->Logs->Log("STARTUP",DEFAULT,"Unable to open config file %s", this->ConfigFileName); - Exit(EXIT_STATUS_CONFIG); +#ifdef WIN32 + /* Windows can (and defaults to) hide file extensions, so let's play a bit nice for windows users. */ + if (ServerConfig::FileExists(this->ConfigFileName + ".txt")) + { + strlcat(this->ConfigFileName, ".txt", MAXBUF); + } + 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); + Exit(EXIT_STATUS_CONFIG); + } } printf_c("\033[1;32mInspire Internet Relay Chat Server, compiled %s at %s\n",__DATE__,__TIME__); |