]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/hashcomp.cpp
Add RE2 regex module.
[user/henk/code/inspircd.git] / src / hashcomp.cpp
index 29b67aea46e75c9ea007137d64ec7dbf4fb2cd79..3f3754884b7d5abb1c7fae9c2528db96734301f2 100644 (file)
@@ -288,7 +288,7 @@ bool irc::tokenstream::GetToken(long &token)
        return returnval;
 }
 
-irc::sepstream::sepstream(const std::string& source, char seperator, bool allowempty)
+irc::sepstream::sepstream(const std::string& source, char separator, bool allowempty)
        : tokens(source), sep(separator), pos(0), allow_empty(allowempty)
 {
 }
@@ -397,14 +397,14 @@ int irc::modestacker::GetStackedLine(std::vector<std::string> &result, int max_l
        return n;
 }
 
-irc::stringjoiner::stringjoiner(const std::string& seperator, const std::vector<std::string>& sequence, unsigned int begin, unsigned int end)
+irc::stringjoiner::stringjoiner(const std::vector<std::string>& sequence)
 {
-       if (end < begin)
+       if (sequence.empty())
                return; // nothing to do here
 
-       for (unsigned int v = begin; v < end; v++)
-               joined.append(sequence[v]).append(seperator);
-       joined.append(sequence[end]);
+       for (std::vector<std::string>::const_iterator i = sequence.begin(); i != sequence.end(); ++i)
+               joined.append(*i).push_back(' ');
+       joined.erase(joined.end()-1);
 }
 
 irc::portparser::portparser(const std::string &source, bool allow_overlapped)