summaryrefslogtreecommitdiff
path: root/src/hostmask.c
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-11-13 20:28:53 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2012-11-13 20:28:53 +0000
commitebb5967a19ee6abdd70a965ff8ca127df47f136f (patch)
tree4b83ace97e2b2d855be8474612014d9af787215e /src/hostmask.c
parente13f9deabc82ad42abb8adf1ab8d416a764aeafc (diff)
- changed match() polarity. match() now returns 0 on match and 1 on non-match
This cleans up several places where function pointers of different matching functions like irccmp/strcmp/match are passed to other functions. - added improved collapse() to match.c git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1652 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src/hostmask.c')
-rw-r--r--src/hostmask.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/hostmask.c b/src/hostmask.c
index 35a9fc3..1e85857 100644
--- a/src/hostmask.c
+++ b/src/hostmask.c
@@ -480,7 +480,7 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ
arec->masktype == HM_IPV6 &&
match_ipv6(addr, &arec->Mask.ipa.addr,
arec->Mask.ipa.bits) &&
- (type & 0x1 || cmpfunc(arec->username, username) == do_match) &&
+ (type & 0x1 || !cmpfunc(arec->username, username)) &&
(IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
match_conf_password(password, arec->conf)))
{
@@ -505,7 +505,7 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ
arec->masktype == HM_IPV4 &&
match_ipv4(addr, &arec->Mask.ipa.addr,
arec->Mask.ipa.bits) &&
- (type & 0x1 || cmpfunc(arec->username, username) == do_match) &&
+ (type & 0x1 || !cmpfunc(arec->username, username)) &&
(IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
match_conf_password(password, arec->conf)))
{
@@ -529,8 +529,8 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ
if ((arec->type == (type & ~0x1)) &&
arec->precedence > hprecv &&
(arec->masktype == HM_HOST) &&
- cmpfunc(arec->Mask.hostname, name) == do_match &&
- (type & 0x1 || cmpfunc(arec->username, username) == do_match) &&
+ !cmpfunc(arec->Mask.hostname, name) &&
+ (type & 0x1 || !cmpfunc(arec->username, username)) &&
(IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
match_conf_password(password, arec->conf)))
{
@@ -551,8 +551,8 @@ find_conf_by_address(const char *name, struct irc_ssaddr *addr, unsigned int typ
if (arec->type == (type & ~0x1) &&
arec->precedence > hprecv &&
arec->masktype == HM_HOST &&
- cmpfunc(arec->Mask.hostname, name) == do_match &&
- (type & 0x1 || cmpfunc(arec->username, username) == do_match) &&
+ !cmpfunc(arec->Mask.hostname, name) &&
+ (type & 0x1 || cmpfunc(arec->username, username)) &&
(IsNeedPassword(arec->conf) || arec->conf->passwd == NULL ||
match_conf_password(password, arec->conf)))
{