]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix crashes and broken code in connect:parent stuff that got broken with introduction...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 26 Oct 2007 23:22:35 +0000 (23:22 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 26 Oct 2007 23:22:35 +0000 (23:22 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8382 e03df62e-2008-0410-955e-edbf42e46eb7

src/configreader.cpp

index b026f5a9f82024b9e6f516f127400d8dde8b30c6..ed1216c8b10652f60af5b1d6aa9ab39ea30b1a85 100644 (file)
@@ -492,17 +492,21 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
                /* Find 'parent' and inherit a new class from it,
                 * then overwrite any values that are set here
                 */
-               for (ClassVector::iterator item = conf->Classes.begin(); item != conf->Classes.end(); ++item)
+               ClassVector::iterator item = conf->Classes.begin();
+               for (; item != conf->Classes.end(); ++item)
                {
                        ConnectClass* c = *item;
+                       conf->GetInstance()->Log(DEBUG,"Class: %s", c->GetName().c_str());
                        if (c->GetName() == parent)
                        {
-                               ConnectClass* c = new ConnectClass(name, c);
-                               c->Update(timeout, flood, *allow ? allow : deny, pingfreq, password, threshold, sendq, recvq, localmax, globalmax, maxchans, port, limit);
-                               conf->Classes.push_back(c);
+                               ConnectClass* newclass = new ConnectClass(name, c);
+                               newclass->Update(timeout, flood, *allow ? allow : deny, pingfreq, password, threshold, sendq, recvq, localmax, globalmax, maxchans, port, limit);
+                               conf->Classes.push_back(newclass);
+                               break;
                        }
                }
-               throw CoreException("Class name '" + std::string(name) + "' is configured to inherit from class '" + std::string(parent) + "' which cannot be found.");
+               if (item == conf->Classes.end())
+                       throw CoreException("Class name '" + std::string(name) + "' is configured to inherit from class '" + std::string(parent) + "' which cannot be found.");
        }
        else
        {