mirror of
https://github.com/anope/anope.git
synced 2026-07-08 18:43:13 +02:00
Merge 83556667fd
This commit is contained in:
+10
-23
@@ -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 = "*";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user