]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
If we can't find file.conf, search for file.conf.txt when on windows.
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 8 Dec 2008 15:02:08 +0000 (15:02 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 8 Dec 2008 15:02:08 +0000 (15:02 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10872 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd.cpp

index ec18728b509962b6b5f0166047efb8779d4a7d5e..527eb95b08bf865429908033b93124b2281e9ef3 100644 (file)
@@ -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__);