kike: fix wildcard handling in WHOIS

This commit is contained in:
Přemysl Eric Janouch 2018-08-01 09:28:41 +02:00
parent 2fccfb10f7
commit f80226620c
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 6 additions and 6 deletions

12
kike.c
View File

@ -2459,12 +2459,12 @@ irc_handle_whois (const struct irc_message *msg, struct client *c)
{ {
struct str_map_iter iter = str_map_iter_make (&c->ctx->users); struct str_map_iter iter = str_map_iter_make (&c->ctx->users);
bool found = false; bool found = false;
while ((target = str_map_iter_next (&iter)) while ((target = str_map_iter_next (&iter)))
&& !irc_fnmatch (mask, target->nickname)) if (!irc_fnmatch (mask, target->nickname))
{ {
irc_send_whois_reply (c, target); irc_send_whois_reply (c, target);
found = true; found = true;
} }
if (!found) if (!found)
irc_send_reply (c, IRC_ERR_NOSUCHNICK, mask); irc_send_reply (c, IRC_ERR_NOSUCHNICK, mask);
} }