X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Flists.c;h=247344e508a6e3daf3fc164d1e47ddbdc0e98152;hp=d98dc6c847ec85cf9d13fca676bb78f26e5dd4df;hb=be887070273c47a07c9bf488630f6fb707976f67;hpb=b4d0a4038398c23d015bd3faf6247a0dd91016a9 diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c index d98dc6c8..247344e5 100644 --- a/src/ngircd/lists.c +++ b/src/ngircd/lists.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors. + * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,22 +16,16 @@ * Management of IRC lists: ban, invite, etc. */ -#include "imp.h" #include +#include +#include +#include +#include -#include "defines.h" #include "conn.h" -#include "channel.h" #include "log.h" #include "match.h" -#include "messages.h" -#include "irc-write.h" - -#include -#include -#include -#include "exp.h" #include "lists.h" struct list_elem { @@ -279,18 +273,19 @@ Lists_MakeMask(const char *Pattern, char *mask, size_t len) if (!at && !excl) { /* Neither "!" nor "@" found: use string as nickname */ - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 5); strlcat(mask, "!*@*", len); } else if (!at && excl) { /* Domain part is missing */ - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 3); strlcat(mask, "@*", len); } else if (at && !excl) { /* User name is missing */ *at = '\0'; at++; - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 5); strlcat(mask, "!*@", len); strlcat(mask, at, len); + at--; *at = '@'; } else { /* All parts (nick, user and domain name) are given */ strlcpy(mask, Pattern, len); @@ -331,7 +326,7 @@ Lists_CheckReason(struct list_head *h, CLIENT *Client, char *reason, size_t len) while (e) { next = e->next; - if (Match(e->mask, Client_MaskCloaked(Client))) { + if (MatchCaseInsensitive(e->mask, Client_MaskCloaked(Client))) { if (len && e->reason) strlcpy(reason, e->reason, len); if (e->valid_until == 1) {