]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove trailing spaces from input in irc::ircsepstream
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 6 Aug 2006 23:38:58 +0000 (23:38 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 6 Aug 2006 23:38:58 +0000 (23:38 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4759 e03df62e-2008-0410-955e-edbf42e46eb7

src/command_parse.cpp
src/hashcomp.cpp

index 922427c289f575d2b101e8fedcd691021ff41947..735d17b8adb67cc0fb25ee9084e3ad6f2dc10190 100644 (file)
@@ -206,7 +206,10 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
        std::string command = tokens.GetToken();
 
        while (((para[items] = tokens.GetToken()) != "") && (items < 127))
+       {
+               log(DEBUG,"Param: '%s'",para[items].c_str());
                command_p[items] = para[items++].c_str();
+       }
 
        std::transform(command.begin(), command.end(), command.begin(), ::toupper);
                
index 9b3b5b5b1c8b64dce75c99149dd46cc127a6ee09..bfbabfde90b5ae8dbfb6882eafd6ffc667631114 100644 (file)
@@ -187,6 +187,11 @@ std::istream& operator>>(std::istream &is, irc::string &str)
 
 irc::tokenstream::tokenstream(const std::string &source) : tokens(source), last_pushed(false)
 {
+       /* Remove trailing spaces, these muck up token parsing */
+       while (tokens.find_last_of(' ') == tokens.length() - 1)
+               tokens.erase(tokens.end() - 1);
+
+       /* Record starting position and current position */
        last_starting_position = tokens.begin();
        n = tokens.begin();
 }