]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Fix typos found by Zaba. Thanks.
[user/henk/code/inspircd.git] / src / configreader.cpp
index 1d027ae93dfe2f7315b772b2c6c2bde2b2b99381..2d62f354a6bc5d0496ef2fdca9ccded273a2ccd3 100644 (file)
@@ -593,6 +593,7 @@ void ServerConfig::Read(bool bail, userrec* user)
        InitialConfig Values[] = {
                {"options",     "softlimit",    MAXCLIENTS_S,           new ValueContainerUInt (&this->SoftLimit),              DT_INTEGER, ValidateSoftLimit},
                {"options",     "somaxconn",    SOMAXCONN_S,            new ValueContainerInt  (&this->MaxConn),                DT_INTEGER, ValidateMaxConn},
+               {"options",     "moronbanner",  "Youre banned!",        new ValueContainerChar (this->MoronBanner),             DT_CHARPTR, NoValidation},
                {"server",      "name",         "",                     new ValueContainerChar (this->ServerName),              DT_CHARPTR, ValidateServerName},
                {"server",      "description",  "Configure Me",         new ValueContainerChar (this->ServerDesc),              DT_CHARPTR, NoValidation},
                {"server",      "network",      "Network",              new ValueContainerChar (this->Network),                 DT_CHARPTR, NoValidation},
@@ -630,7 +631,7 @@ void ServerConfig::Read(bool bail, userrec* user)
                {"options",     "hostintopic",  "1",                    new ValueContainerBool (&this->FullHostInTopic),        DT_BOOLEAN, NoValidation},
                {"options",     "hidemodes",    "",                     new ValueContainerChar (hidemodes),                     DT_CHARPTR, ValidateModeLists},
                {"options",     "exemptchanops","",                     new ValueContainerChar (exemptchanops),                 DT_CHARPTR, ValidateExemptChanOps},
-               {"options",     "defaultmodes", "",                     new ValueContainerChar (this->DefaultModes),            DT_CHARPTR, NoValidation},
+               {"options",     "defaultmodes", "nt",                   new ValueContainerChar (this->DefaultModes),            DT_CHARPTR, NoValidation},
                {"pid",         "file",         "",                     new ValueContainerChar (this->PID),                     DT_CHARPTR, NoValidation},
                {"whowas",      "groupsize",    "10",                   new ValueContainerInt  (&this->WhoWasGroupSize),        DT_INTEGER, NoValidation},
                {"whowas",      "maxgroups",    "10240",                new ValueContainerInt  (&this->WhoWasMaxGroups),        DT_INTEGER, NoValidation},
@@ -1483,19 +1484,20 @@ bool ServerConfig::ReadFile(file_cache &F, const char* fname)
 
        F.clear();
 
-       if (*fname != '/')
+       if ((*fname != '/') && (*fname != '\\'))
        {
                std::string::size_type pos;
                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;
-                       if (!FileExists(newfile.c_str()))
-                               return false;
-                       file =  fopen(newfile.c_str(), "r");
+               std::string newfile = fname;
 
-               }
+               if ((pos = confpath.rfind("/")) != std::string::npos)
+                       newfile = confpath.substr(0, pos) + std::string("/") + fname;
+               else if ((pos = confpath.rfind("\\")) != std::string::npos)
+                       newfile = confpath.substr(0, pos) + std::string("\\") + fname;
+
+               if (!FileExists(newfile.c_str()))
+                       return false;
+               file =  fopen(newfile.c_str(), "r");
        }
        else
        {
@@ -1549,7 +1551,7 @@ bool ServerConfig::FileExists(const char* file)
 char* ServerConfig::CleanFilename(char* name)
 {
        char* p = name + strlen(name);
-       while ((p != name) && (*p != '/')) p--;
+       while ((p != name) && (*p != '/') && (*p != '\\')) p--;
        return (p != name ? ++p : p);
 }
 
@@ -1629,19 +1631,16 @@ std::string ServerConfig::GetFullProgDir()
        // Get the current working directory
        if (getcwd(buffer, PATH_MAX))
        {
-               ServerInstance->Log(DEBUG,"getcwd='%s', argv[0]='%s'", buffer, this->argv[0]);
                std::string remainder = this->argv[0];
 
                /* Does argv[0] start with /? its a full path, use it */
                if (remainder[0] == '/')
                {
-                       ServerInstance->Log(DEBUG,"argv starts with slash, using for full path.");
                        std::string::size_type n = remainder.rfind("/inspircd");
                        return std::string(remainder, 0, n);
                }
 
                std::string fullpath = std::string(buffer) + "/" + remainder;
-               ServerInstance->Log(DEBUG,"Using concatenation: %s", fullpath.c_str());
                std::string::size_type n = fullpath.rfind("/inspircd");
                return std::string(fullpath, 0, n);
        }