summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index ffa30fb84..bba8dc8dc 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -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);
+ }
}