]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Add DYING link state, push error messages on link, and only limit recvq on unauthenti...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 94ba6a03728e42d989f313b33abf49d8d141bd12..bba8dc8dca480f220d4b3a48f666ce2d360c0f24 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -396,13 +396,18 @@ std::string InspIRCd::TimeString(time_t curtime)
 void InspIRCd::AddExtBanChar(char c)
 {
        std::string &tok = Config->data005;
-       std::string::size_type ebpos;
+       std::string::size_type ebpos = tok.find(" EXTBAN=,");
 
-       if ((ebpos = tok.find(" EXTBAN=,")) == std::string::npos)
+       if (ebpos == std::string::npos)
        {
                tok.append(" EXTBAN=,");
                tok.push_back(c);
        }
        else
-               tok.insert(ebpos + 9, 1, c);
+       {
+               ebpos += 9;
+               while (isalpha(tok[ebpos]) && tok[ebpos] < c)
+                       ebpos++;
+               tok.insert(ebpos, 1, c);
+       }
 }