diff options
author | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-08-08 04:06:03 +0000 |
---|---|---|
committer | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-08-08 04:06:03 +0000 |
commit | 43d72713c542810fd07c170e5c29ed7810eb3896 (patch) | |
tree | 5052ffa22657937bf59e86d4bad2c8a751808bda | |
parent | 8df2076024739c7077bd5034dfea34309b8586b0 (diff) |
Fixed some problems with sepstream when parsing one char tokens
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2436 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/hashcomp.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 63b758924..0636b3116 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -121,15 +121,14 @@ bool sepstream::GetToken(std::string &token) if (*n == sep || n + 1 == tokens.end()) { last_starting_position = n + 1; - token = std::string(lsp, n + 1 == tokens.end() ? n + 1 : n++); + token = std::string(lsp, n + 1 == tokens.end() ? n + 1 : n); while (token.length() && token.find_last_of(sep) == token.length() - 1) token.erase(token.end() - 1); - if (token.empty()) - ++n; + ++n; - return n == tokens.end() ? false : true; + return true; } ++n; @@ -146,5 +145,5 @@ const std::string sepstream::GetRemaining() bool sepstream::StreamEnd() { - return n + 1 == tokens.end(); + return n == tokens.end(); } |