summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-28 16:45:05 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-28 16:45:05 +0000
commitec9bd01f58ae5354dfe1bf05798f45ec836e02f6 (patch)
treefb2128902bc86bab6049735b8c3bbc3612283da1 /src
parent87fabe626628a4132a309880dc2051f0c730720a (diff)
Move trailing space stripping to only strip from non-last-item values (dont ask)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5049 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/hashcomp.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index f5cc5efe0..aa53da964 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -206,10 +206,6 @@ 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();
@@ -243,7 +239,12 @@ const std::string irc::tokenstream::GetToken()
*/
last_starting_position = n+1;
last_pushed = true;
- return std::string(lsp, n+1 == tokens.end() ? n+1 : n++);
+
+ std::string strip(lsp, n+1 == tokens.end() ? n+1 : n++);
+ while ((strip.length()) && (strip.find_last_of(' ') == strip.length() - 1))
+ strip.erase(strip.end() - 1);
+
+ return strip;
}
n++;