summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/ignore.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/ignore.c b/src/core/ignore.c
index 5c7f08fe..a954443c 100644
--- a/src/core/ignore.c
+++ b/src/core/ignore.c
@@ -160,12 +160,13 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
if (len > best_mask) {
best_mask = len;
best_match = !rec->exception;
- } else if (len == best_mask && rec->pattern != NULL) {
- len = strlen(rec->pattern);
+ } else if (len == best_mask) {
+ len = rec->pattern == NULL ? 0 : strlen(rec->pattern);
if (len > best_patt) {
best_patt = len;
best_match = !rec->exception;
- }
+ } else if (len == best_patt && rec->exception)
+ best_match = 0;
}
}
}