Add inv_strpbrk() function and convert equivalent sindex() calls

inv_strpbrk() is the inverse of the standard function strpbrk().

Calls to sindex() where both strings are not NULL and the second string begins with ^ are equivalent
to calls to inv_strpbrk() (but without the ^).  Convert those calls.
This commit is contained in:
Kevin Easton
2017-11-17 17:19:07 +11:00
parent 8c7d9334dd
commit 0d5698d41b
3 changed files with 26 additions and 17 deletions

View File

@@ -3526,7 +3526,7 @@ BUILT_IN_COMMAND(untopic)
ChannelList *chan;
int server;
args = sindex(args, "^ ");
args = inv_strpbrk(args, " ");
if (is_channel(args))
channel = next_arg(args, &args);
@@ -3543,12 +3543,12 @@ BUILT_IN_COMMAND(e_topic)
ChannelList *chan;
int server;
args = sindex(args, "^ ");
args = inv_strpbrk(args, " ");
if (is_channel(args))
{
channel = next_arg(args, &args);
args = sindex(args, "^ ");
args = inv_strpbrk(args, " ");
}
if (!(chan = prepare_command(&server, channel, args ? PC_TOPIC : NO_OP)))