summaryrefslogtreecommitdiff
path: root/modules/core
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 /modules/core
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 'modules/core')
-rw-r--r--modules/core/m_message.c2
-rw-r--r--modules/core/m_server.c8
-rw-r--r--modules/core/m_squit.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/modules/core/m_message.c b/modules/core/m_message.c
index e72126d..f84e1a3 100644
--- a/modules/core/m_message.c
+++ b/modules/core/m_message.c
@@ -888,7 +888,7 @@ find_userhost(char *user, char *host, int *count)
if (!IsClient(c2ptr)) /* something other than a client */
continue;
- if ((!host || match(host, c2ptr->host)) &&
+ if ((!host || !match(host, c2ptr->host)) &&
irccmp(user, c2ptr->username) == 0)
{
(*count)++;
diff --git a/modules/core/m_server.c b/modules/core/m_server.c
index a1eb5e7..39fecd5 100644
--- a/modules/core/m_server.c
+++ b/modules/core/m_server.c
@@ -274,14 +274,14 @@ ms_server(struct Client *client_p, struct Client *source_p,
* leaf. If so, close the link.
*/
DLINK_FOREACH(ptr, conf->leaf_list.head)
- if (match(ptr->data, name))
+ if (!match(ptr->data, name))
{
llined = 1;
break;
}
DLINK_FOREACH(ptr, conf->hub_list.head)
- if (match(ptr->data, name))
+ if (!match(ptr->data, name))
{
hlined = 1;
break;
@@ -471,14 +471,14 @@ ms_sid(struct Client *client_p, struct Client *source_p,
* leaf. If so, close the link.
*/
DLINK_FOREACH(ptr, conf->leaf_list.head)
- if (match(ptr->data, parv[1]))
+ if (!match(ptr->data, parv[1]))
{
llined = 1;
break;
}
DLINK_FOREACH(ptr, conf->hub_list.head)
- if (match(ptr->data, parv[1]))
+ if (!match(ptr->data, parv[1]))
{
hlined = 1;
break;
diff --git a/modules/core/m_squit.c b/modules/core/m_squit.c
index 7ba9b43..fb15b3c 100644
--- a/modules/core/m_squit.c
+++ b/modules/core/m_squit.c
@@ -71,7 +71,7 @@ mo_squit(struct Client *client_p, struct Client *source_p,
if (IsServer(p) || IsMe(p))
{
- if (match(server, p->name))
+ if (!match(server, p->name))
{
target_p = p;
break;