diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-02 22:11:14 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-02 22:11:14 +0000 |
commit | 5870145ac255da65f5bf4ff0fae4715cbb930ec9 (patch) | |
tree | 91684986ad437786fe85ba6a18973c62ebd3b02a /src/hashcomp.cpp | |
parent | ef960ee420460e437b49e8085c3f1158c60752b9 (diff) |
This needs some general QA-ing. Add support to new parser (introduced in 1.1) for empty final params (just the colon)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6731 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/hashcomp.cpp')
-rw-r--r-- | src/hashcomp.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index b78b66af6..1e6db3f65 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -190,7 +190,7 @@ irc::tokenstream::~tokenstream() { } -const std::string irc::tokenstream::GetToken() +bool irc::tokenstream::GetToken(std::string &token) { std::string::iterator lsp = last_starting_position; @@ -208,7 +208,8 @@ const std::string irc::tokenstream::GetToken() */ std::string::iterator curr = ++n; n = tokens.end(); - return std::string(curr, tokens.end()); + token = std::string(curr, tokens.end()); + return true; } last_pushed = false; @@ -224,12 +225,14 @@ const std::string irc::tokenstream::GetToken() while ((strip.length()) && (strip.find_last_of(' ') == strip.length() - 1)) strip.erase(strip.end() - 1); - return strip; + token = strip; + return !token.empty(); } n++; } - return ""; + token = ""; + return false; } irc::sepstream::sepstream(const std::string &source, char seperator) : tokens(source), sep(seperator) |