X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigreader.cpp;h=51045ef5859a8dba15f215e3666849a43f7e9b64;hb=48045988a48a738a1ffa183fdc1e335a431312a8;hp=e23f5750d32f872aee18e621c9d7f746920a36ce;hpb=929cd28544c59d122a8d36b2b5e3a394aa03108b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index e23f5750d..51045ef58 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -2046,64 +2046,6 @@ char* ServerConfig::CleanFilename(char* name) } -bool ServerConfig::DirValid(const char* dirandfile) -{ -#ifdef WINDOWS - return true; -#else - - char work[1024]; - char buffer[1024]; - char otherdir[1024]; - int p; - - strlcpy(work, dirandfile, 1024); - p = strlen(work); - - // we just want the dir - while (*work) - { - if (work[p] == '/') - { - work[p] = '\0'; - break; - } - - work[p--] = '\0'; - } - - // Get the current working directory - if (getcwd(buffer, 1024 ) == NULL ) - return false; - - if (chdir(work) == -1) - return false; - - if (getcwd(otherdir, 1024 ) == NULL ) - return false; - - if (chdir(buffer) == -1) - return false; - - size_t t = strlen(work); - - if (strlen(otherdir) >= t) - { - otherdir[t] = '\0'; - if (!strcmp(otherdir,work)) - { - return true; - } - - return false; - } - else - { - return false; - } -#endif -} - std::string ServerConfig::GetFullProgDir() { char buffer[PATH_MAX]; @@ -2205,15 +2147,6 @@ bool ValueItem::GetBool() */ bool InitTypes(ServerConfig* conf, const char*) { - if (conf->opertypes.size()) - { - for (opertype_t::iterator n = conf->opertypes.begin(); n != conf->opertypes.end(); n++) - { - if (n->second) - delete[] n->second; - } - } - conf->opertypes.clear(); return true; } @@ -2250,7 +2183,7 @@ bool DoType(ServerConfig* conf, const char*, char**, ValueList &values, int*) const char* TypeName = values[0].GetString(); const char* Classes = values[1].GetString(); - conf->opertypes[TypeName] = strnewdup(Classes); + conf->opertypes[TypeName] = std::string(Classes); return true; }