1
0
mirror of https://github.com/irssi/irssi.git synced 2024-07-21 03:14:16 -04:00

masks_match() was buggy

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@623 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-08-24 00:56:46 +00:00 committed by cras
parent 6415f506de
commit cac3d29be9

View File

@ -88,22 +88,29 @@ int irc_mask_match_address(const char *mask, const char *nick,
int irc_masks_match(const char *masks, const char *nick, const char *address)
{
char **list, **tmp, *mask;
int found;
g_return_val_if_fail(masks != NULL, FALSE);
found = FALSE;
mask = g_strdup_printf("%s!%s", nick, address);
list = g_strsplit(masks, " ", -1);
for (tmp = list; *tmp != NULL; tmp++) {
if (strchr(*tmp, '!') == NULL && g_strcasecmp(*tmp, nick) == 0)
if (strchr(*tmp, '!') == NULL &&
g_strcasecmp(*tmp, nick) == 0) {
found = TRUE;
break;
}
if (match_wildcards(*tmp, mask))
if (match_wildcards(*tmp, mask)) {
found = TRUE;
break;
}
}
g_strfreev(list);
g_free(mask);
return *tmp != NULL;
return found;
}
static char *get_domain_mask(char *host)