X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fconfigreader.cpp;h=5b582b7138d1f71f2321d4489d6effe84168faec;hb=82bf46fa061a4f18071e73756e4e0d618eb57320;hp=2ee6ace26e81bb942791186fc82fd7f5fe0f5a40;hpb=e7c95d470d08ed4da36e1bdc863903246c2d9683;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configreader.cpp b/src/configreader.cpp index 2ee6ace26..5b582b713 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1889,11 +1889,13 @@ bool ServerConfig::ReadFile(file_cache &F, const char* fname) std::string confpath = ServerInstance->ConfigFileName; std::string newfile = fname; - if ((pos = confpath.rfind("/")) != std::string::npos) + if (((pos = confpath.rfind("/"))) != std::string::npos) newfile = confpath.substr(0, pos) + std::string("/") + fname; - else if ((pos = confpath.rfind("\\")) != std::string::npos) + else if (((pos = confpath.rfind("\\"))) != std::string::npos) newfile = confpath.substr(0, pos) + std::string("\\") + fname; + ServerInstance->Logs->Log("config", DEBUG, "Filename: %s", newfile.c_str()); + if (!FileExists(newfile.c_str())) return false; file = fopen(newfile.c_str(), "r"); @@ -1914,10 +1916,7 @@ bool ServerConfig::ReadFile(file_cache &F, const char* fname) else *linebuf = 0; - if (!feof(file)) - { - F.push_back(*linebuf ? linebuf : " "); - } + F.push_back(*linebuf ? linebuf : " "); } fclose(file);