]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Fix multiple (useless) linefeeds on the end of ADDLINE in burst
[user/henk/code/inspircd.git] / src / configreader.cpp
index 7a7934f16ebdedee1e29da9e03bbc09b1b8bb3e8..7ca1a81250c3f403975553df77c603ff9351c4e3 100644 (file)
@@ -520,13 +520,6 @@ bool InitConnect(ServerConfig* conf, const char*)
 {
        conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"Reading connect classes...");
 
-       for (ClassVector::iterator i = conf->Classes.begin(); i != conf->Classes.end(); i++)
-       {
-               ConnectClass *c = *i;
-
-               conf->GetInstance()->Logs->Log("CONFIG",DEBUG, "Address of class is %p", c);
-       }
-
        for (ClassVector::iterator i = conf->Classes.begin(); i != conf->Classes.end() ; )
        {
                ConnectClass* c = *i;
@@ -1281,6 +1274,8 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, FILE* &conf, const char* fil
        in_quote = false;
        in_comment = false;
 
+       ServerInstance->Logs->Log("CONFIG", DEBUG, "Reading %s", filename);
+
        /* Check if the file open failed first */
        if (!conf)
        {
@@ -1301,9 +1296,9 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, FILE* &conf, const char* fil
        include_stack.push_back(filename);
 
        /* Start reading characters... */
-       while ((ch = fgetc(conf)))
+       while (!feof(conf))
        {
-
+               ch = fgetc(conf);
                /*
                 * Fix for moronic windows issue spotted by Adremelech.
                 * Some windows editors save text files as utf-16, which is
@@ -1360,8 +1355,9 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, FILE* &conf, const char* fil
                {
                        line += ch;
                        char real_character;
-                       if ((real_character = fgetc(conf)))
+                       if (!feof(conf))
                        {
+                               real_character = fgetc(conf);
                                if (real_character == 'n')
                                        real_character = '\n';
                                line += real_character;