1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 18:43:13 +02:00
This commit is contained in:
Adam
2011-02-04 22:10:39 -05:00
parent 032c30dd5d
commit b2e52553a7
10 changed files with 200 additions and 133 deletions
+10 -23
View File
@@ -39,34 +39,21 @@ public:
if (pattern[0] == '#')
{
Anope::string tmp = myStrGetToken(pattern.substr(1), '-', 0); /* Read FROM out */
if (tmp.empty())
Anope::string n1 = myStrGetToken(pattern.substr(1), '-', 0), /* Read FROM out */
n2 = myStrGetToken(pattern, '-', 1);
try
{
from = convertTo<int>(n1);
to = convertTo<int>(n2);
}
catch (const CoreException &)
{
u->SendMessage(ChanServ, LIST_INCORRECT_RANGE);
u->SendMessage(ChanServ, CS_LIST_INCORRECT_RANGE);
return MOD_CONT;
}
if (!tmp.is_number_only())
{
u->SendMessage(ChanServ, LIST_INCORRECT_RANGE);
u->SendMessage(ChanServ, CS_LIST_INCORRECT_RANGE);
return MOD_CONT;
}
from = convertTo<int>(tmp);
tmp = myStrGetTokenRemainder(pattern, '-', 1); /* Read TO out */
if (tmp.empty())
{
u->SendMessage(ChanServ, LIST_INCORRECT_RANGE);
u->SendMessage(ChanServ, CS_LIST_INCORRECT_RANGE);
return MOD_CONT;
}
if (!tmp.is_number_only())
{
u->SendMessage(ChanServ, LIST_INCORRECT_RANGE);
u->SendMessage(ChanServ, CS_LIST_INCORRECT_RANGE);
return MOD_CONT;
}
to = convertTo<int>(tmp);
pattern = "*";
}