From cac3d29be98cf15ff4f2146dde54b9c88efd7de2 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 24 Aug 2000 00:56:46 +0000 Subject: [PATCH] masks_match() was buggy git-svn-id: http://svn.irssi.org/repos/irssi/trunk@623 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/masks.c | 13 ++++++++++--- 1 file 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)