1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 05:56:38 +02:00

Fix long-standing issue with the get token functions if the delimiter wasn't found in the string but you wanted the first "token".

This commit is contained in:
Naram Qashat
2011-06-20 23:09:03 -04:00
parent a3d0ab3d09
commit 2601871391
+2 -2
View File
@@ -416,7 +416,7 @@ bool isvalidchar(char c)
Anope::string myStrGetToken(const Anope::string &str, char dilim, int token_number)
{
if (str.empty() || str.find(dilim) == Anope::string::npos)
return "";
return token_number ? "" : str;
Anope::string substring;
sepstream sep(str, dilim);
@@ -438,7 +438,7 @@ Anope::string myStrGetToken(const Anope::string &str, char dilim, int token_numb
Anope::string myStrGetTokenRemainder(const Anope::string &str, const char dilim, int token_number)
{
if (str.empty() || str.find(dilim) == Anope::string::npos)
return "";
return token_number ? "" : str;
Anope::string substring;
sepstream sep(str, dilim);