]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
- Modify ServerConfig::GetFullProgDir to just return cwd, previously it did a lot...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 3f0b5ff0ce8ceb93d22710a1f38d456fe78ec287..03d6879baf814540367909f9070d1e5f56677b6e 100644 (file)
@@ -405,9 +405,33 @@ bool InspIRCd::IsNick(const char* n)
        return (p < NICKMAX - 1);
 }
 
+
+bool InspIRCd::IsIdent(const char* n)
+{
+       if (!n || !*n)
+               return false;
+
+       for (char* i = (char*)n; *i; i++)
+       {
+               if ((*i >= 'A') && (*i <= '}'))
+               {
+                       continue;
+               }
+
+               if (((*i >= '0') && (*i <= '9')) || (*i == '-') || (*i == '.'))
+               {
+                       continue;
+               }
+
+               return false;
+       }
+
+       return true;
+}
+
 void InspIRCd::OpenLog(char** argv, int argc)
 {
-       Config->MyDir = ServerConfig::GetFullProgDir(argv,argc);
+       Config->MyDir = ServerConfig::GetFullProgDir();
 
        if (!*this->LogFileName)
        {
@@ -462,16 +486,16 @@ void InspIRCd::LoadAllModules()
        for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "module"); count++)
        {
                Config->ConfValue(Config->config_data, "module", "name", count, configToken, MAXBUF);
-               printf("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
+               printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
                
                if (!this->LoadModule(configToken))             
                {
                        this->Log(DEFAULT,"There was an error loading the module '%s': %s", configToken, this->ModuleError());
-                       printf("\n[\033[1;31m*\033[0m] There was an error loading the module '%s': %s\n\n", configToken, this->ModuleError());
+                       printf_c("\n[\033[1;31m*\033[0m] There was an error loading the module '%s': %s\n\n", configToken, this->ModuleError());
                        Exit(EXIT_STATUS_MODULE);
                }
        }
-       printf("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", this->ModCount+1, this->ModCount+1 == 1 ? " has" : "s have");
+       printf_c("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", this->ModCount+1, this->ModCount+1 == 1 ? " has" : "s have");
        this->Log(DEFAULT,"Total loaded modules: %d", this->ModCount+1);
 }