]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Microsoft, in their "infinite wisdom" decide to have no sensible naming convention...
[user/henk/code/inspircd.git] / src / configreader.cpp
index 2ee6ace26e81bb942791186fc82fd7f5fe0f5a40..5b582b7138d1f71f2321d4489d6effe84168faec 100644 (file)
@@ -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);