diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-24 00:56:46 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-24 00:56:46 +0000 |
commit | cac3d29be98cf15ff4f2146dde54b9c88efd7de2 (patch) | |
tree | 491adfdfc9198fec9cb1fa5846552ab11902a896 /src/irc | |
parent | 6415f506ded8ae523bacdd6c2f3d110257c5b8fc (diff) | |
download | irssi-cac3d29be98cf15ff4f2146dde54b9c88efd7de2.zip |
masks_match() was buggy
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@623 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/masks.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/irc/core/masks.c b/src/irc/core/masks.c index e2942140..35364da2 100644 --- a/src/irc/core/masks.c +++ b/src/irc/core/masks.c @@ -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) |