diff options
| author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-16 06:19:37 +0000 |
|---|---|---|
| committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-16 06:19:37 +0000 |
| commit | 22e8e87a00404725f32f4a53f57809d917876914 (patch) | |
| tree | 0833c986ac7149a61227830d3472bb83fb94172e /src/core | |
| parent | 15a2e1d4e4ffae3b351cb45183e9a868af37ead1 (diff) | |
Patch from DukePyrolator to replace all calls to match_wild() and match_wild_nocase() to use Anope::Match() instead. Also changes line-endings on wildcard.cpp to Unix-style, as well as fixes a small compile warning in language.c.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2080 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/bs_badwords.c | 2 | ||||
| -rw-r--r-- | src/core/cs_access.c | 2 | ||||
| -rw-r--r-- | src/core/cs_akick.c | 10 | ||||
| -rw-r--r-- | src/core/cs_list.c | 4 | ||||
| -rw-r--r-- | src/core/cs_xop.c | 2 | ||||
| -rw-r--r-- | src/core/hs_list.c | 2 | ||||
| -rw-r--r-- | src/core/ns_access.c | 4 | ||||
| -rw-r--r-- | src/core/ns_list.c | 4 | ||||
| -rw-r--r-- | src/core/os_admin.c | 2 | ||||
| -rw-r--r-- | src/core/os_akill.c | 4 | ||||
| -rw-r--r-- | src/core/os_chanlist.c | 2 | ||||
| -rw-r--r-- | src/core/os_noop.c | 2 | ||||
| -rw-r--r-- | src/core/os_oper.c | 2 | ||||
| -rw-r--r-- | src/core/os_session.c | 4 | ||||
| -rw-r--r-- | src/core/os_sgline.c | 4 | ||||
| -rw-r--r-- | src/core/os_sqline.c | 4 | ||||
| -rw-r--r-- | src/core/os_szline.c | 4 | ||||
| -rw-r--r-- | src/core/os_userlist.c | 2 |
18 files changed, 30 insertions, 30 deletions
diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c index 1b7007745..a342e0c09 100644 --- a/src/core/bs_badwords.c +++ b/src/core/bs_badwords.c @@ -44,7 +44,7 @@ class CommandBSBadwords : public Command if (!(ci->badwords[i].in_use)) continue; if (word && ci->badwords[i].word - && !match_wild_nocase(word, ci->badwords[i].word)) + && !Anope::Match(word, ci->badwords[i].word, false)) continue; badwords_list(u, i, ci, &sent_header); } diff --git a/src/core/cs_access.c b/src/core/cs_access.c index ec58b75ea..0d3bc9ea0 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -335,7 +335,7 @@ class CommandCSAccess : public Command } else { for (i = 0; i < ci->accesscount; i++) { if (nick && ci->access[i].nc - && !match_wild_nocase(nick, ci->access[i].nc->display)) + && !Anope::Match(nick, ci->access[i].nc->display, false)) continue; access_list(u, i, ci, &sent_header); } diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index a0efdc067..0f360f009 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -264,7 +264,7 @@ class CommandCSAKick : public Command if (na2->nc && ((na2->nc == ci->founder) || (get_access_nc(na2->nc, ci) >= get_access(u, ci)))) { snprintf(buf, BUFSIZE, "%s!%s", na2->nick, na2->last_usermask); - if (match_wild_nocase(mask, buf)) { + if (Anope::Match(mask, buf, false)) { notice_lang(s_ChanServ, u, PERMISSION_DENIED); delete [] mask; return MOD_CONT; @@ -536,10 +536,10 @@ class CommandCSAKick : public Command continue; if (mask) { if (!(akick->flags & AK_ISNICK) - && !match_wild_nocase(mask, akick->u.mask)) + && !Anope::Match(mask, akick->u.mask, false)) continue; if ((akick->flags & AK_ISNICK) - && !match_wild_nocase(mask, akick->u.nc->display)) + && !Anope::Match(mask, akick->u.nc->display, false)) continue; } akick_list(u, i, ci, &sent_header); @@ -565,10 +565,10 @@ class CommandCSAKick : public Command continue; if (mask) { if (!(akick->flags & AK_ISNICK) - && !match_wild_nocase(mask, akick->u.mask)) + && !Anope::Match(mask, akick->u.mask, false)) continue; if ((akick->flags & AK_ISNICK) - && !match_wild_nocase(mask, akick->u.nc->display)) + && !Anope::Match(mask, akick->u.nc->display, false)) continue; } akick_view(u, i, ci, &sent_header); diff --git a/src/core/cs_list.c b/src/core/cs_list.c index f4ccc843a..bb3244cc2 100644 --- a/src/core/cs_list.c +++ b/src/core/cs_list.c @@ -136,8 +136,8 @@ public: if ((stricmp(pattern, ci->name) == 0) || (stricmp(spattern, ci->name) == 0) - || match_wild_nocase(pattern, ci->name) - || match_wild_nocase(spattern, ci->name)) + || Anope::Match(pattern, ci->name, false) + || Anope::Match(spattern, ci->name, false)) { if ((((count + 1 >= from) && (count + 1 <= to)) || ((from == 0) && (to == 0))) diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index 569ea3cdc..2fa830bd2 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -354,7 +354,7 @@ class XOPBase : public Command { for (int i = 0; i < ci->accesscount; ++i) { - if (nick && ci->access[i].nc && !match_wild_nocase(nick, ci->access[i].nc->display)) + if (nick && ci->access[i].nc && !Anope::Match(nick, ci->access[i].nc->display, false)) continue; xop_list(u, i, ci, &sent_header, level, messages[XOP_LIST_HEADER]); } diff --git a/src/core/hs_list.c b/src/core/hs_list.c index 21ca61689..3dfa52506 100644 --- a/src/core/hs_list.c +++ b/src/core/hs_list.c @@ -94,7 +94,7 @@ class CommandHSList : public Command { if (key) { - if ((match_wild_nocase(key, current->nick) || match_wild_nocase(key, current->vHost)) && display_counter < NSListMax) + if ((Anope::Match(key, current->nick, false) || Anope::Match(key, current->vHost, false)) && display_counter < NSListMax) { ++display_counter; tm = localtime(¤t->time); diff --git a/src/core/ns_access.c b/src/core/ns_access.c index e8e43b298..f1a1749d1 100644 --- a/src/core/ns_access.c +++ b/src/core/ns_access.c @@ -49,7 +49,7 @@ class CommandNSAccess : public Command notice_lang(s_NickServ, u, NICK_ACCESS_LIST_X, params[1].c_str()); for (access = nc->access, i = 0; i < nc->accesscount; ++access, ++i) { - if (mask && !match_wild(mask, *access)) + if (mask && !Anope::Match(mask, *access, true)) continue; u->SendMessage(s_NickServ, " %s", *access); } @@ -143,7 +143,7 @@ class CommandNSAccess : public Command notice_lang(s_NickServ, u, NICK_ACCESS_LIST); for (access = nc->access, i = 0; i < nc->accesscount; ++access, ++i) { - if (mask && !match_wild(mask, *access)) + if (mask && !Anope::Match(mask, *access, true)) continue; u->SendMessage(s_NickServ, " %s", *access); } diff --git a/src/core/ns_list.c b/src/core/ns_list.c index 407d1bcd1..7ab2639de 100644 --- a/src/core/ns_list.c +++ b/src/core/ns_list.c @@ -143,7 +143,7 @@ class CommandNSList : public Command * Instead we build a nice nick!user@host buffer to compare. * The output is then generated separately. -TheShadow */ snprintf(buf, sizeof(buf), "%s!%s", na->nick, na->last_usermask && !(na->status & NS_FORBIDDEN) ? na->last_usermask : "*@*"); - if (!stricmp(pattern, na->nick) || match_wild_nocase(pattern, buf)) + if (!stricmp(pattern, na->nick) || Anope::Match(pattern, buf, false)) { if (((count + 1 >= from && count + 1 <= to) || (!from && !to)) && ++nnicks <= NSListMax) { @@ -175,7 +175,7 @@ class CommandNSList : public Command for (nr = nrlists[i]; nr; nr = nr->next) { snprintf(buf, sizeof(buf), "%s!*@*", nr->nick); - if (!stricmp(pattern, nr->nick) || match_wild_nocase(pattern, buf)) + if (!stricmp(pattern, nr->nick) || Anope::Match(pattern, buf, false)) { if (++nnicks <= NSListMax) { diff --git a/src/core/os_admin.c b/src/core/os_admin.c index 06391e498..9dc103b99 100644 --- a/src/core/os_admin.c +++ b/src/core/os_admin.c @@ -180,7 +180,7 @@ class CommandOSAdmin : public Command int i; for (i = 0; i < servadmins.count; ++i) { - if (!stricmp(nick, (static_cast<NickCore *>(servadmins.list[i]))->display) || match_wild_nocase(nick, (static_cast<NickCore *>(servadmins.list[i]))->display)) + if (!stricmp(nick, (static_cast<NickCore *>(servadmins.list[i]))->display) || Anope::Match(nick, (static_cast<NickCore *>(servadmins.list[i]))->display, false)) admin_list(i + 1, static_cast<NickCore *>(servadmins.list[i]), u, &sent_header); } diff --git a/src/core/os_akill.c b/src/core/os_akill.c index 7d5947db7..8f12e2ff0 100644 --- a/src/core/os_akill.c +++ b/src/core/os_akill.c @@ -225,7 +225,7 @@ class CommandOSAKill : public Command for (i = 0; i < akills.count; ++i) { snprintf(amask, sizeof(amask), "%s@%s", (static_cast<Akill *>(akills.list[i]))->user, (static_cast<Akill *>(akills.list[i]))->host); - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) akill_list(i + 1, static_cast<Akill *>(akills.list[i]), u, &sent_header); } @@ -268,7 +268,7 @@ class CommandOSAKill : public Command for (i = 0; i < akills.count; ++i) { snprintf(amask, sizeof(amask), "%s@%s", (static_cast<Akill *>(akills.list[i]))->user, (static_cast<Akill *>(akills.list[i]))->host); - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) akill_view(i + 1, static_cast<Akill *>(akills.list[i]), u, &sent_header); } diff --git a/src/core/os_chanlist.c b/src/core/os_chanlist.c index d86beaeed..abb5deecd 100644 --- a/src/core/os_chanlist.c +++ b/src/core/os_chanlist.c @@ -59,7 +59,7 @@ class CommandOSChanList : public Command { for (c = chanlist[i]; c; c = c->next) { - if (pattern && !match_wild_nocase(pattern, c->name)) + if (pattern && !Anope::Match(pattern, c->name, false)) continue; if (modes && !(c->mode & modes)) continue; diff --git a/src/core/os_noop.c b/src/core/os_noop.c index cf1bdf23e..de49185f1 100644 --- a/src/core/os_noop.c +++ b/src/core/os_noop.c @@ -47,7 +47,7 @@ class CommandOSNOOP : public Command for (u2 = firstuser(); u2; u2 = u3) { u3 = nextuser(); - if (u2 && is_oper(u2) && u2->server->name && match_wild(server, u2->server->name)) + if (u2 && is_oper(u2) && u2->server->name && Anope::Match(server, u2->server->name, true)) kill_user(s_OperServ, u2->nick, reason); } } diff --git a/src/core/os_oper.c b/src/core/os_oper.c index 7ddceb257..ce2ab8158 100644 --- a/src/core/os_oper.c +++ b/src/core/os_oper.c @@ -187,7 +187,7 @@ class CommandOSOper : public Command for (i = 0; i < servopers.count; ++i) { - if (!stricmp(nick, (static_cast<NickCore *>(servopers.list[i]))->display) || match_wild_nocase(nick, (static_cast<NickCore *>(servopers.list[i]))->display)) + if (!stricmp(nick, (static_cast<NickCore *>(servopers.list[i]))->display) || Anope::Match(nick, (static_cast<NickCore *>(servopers.list[i]))->display, false)) oper_list(i + 1, static_cast<NickCore *>(servopers.list[i]), u, &sent_header); } diff --git a/src/core/os_session.c b/src/core/os_session.c index a1c19113e..ac6910c36 100644 --- a/src/core/os_session.c +++ b/src/core/os_session.c @@ -382,7 +382,7 @@ class CommandOSException : public Command { for (i = 0; i < nexceptions; ++i) { - if (!mask || match_wild_nocase(mask, exceptions[i].mask)) + if (!mask || Anope::Match(mask, exceptions[i].mask, false)) exception_list(u, i, &sent_header); } } @@ -404,7 +404,7 @@ class CommandOSException : public Command { for (i = 0; i < nexceptions; ++i) { - if (!mask || match_wild_nocase(mask, exceptions[i].mask)) + if (!mask || Anope::Match(mask, exceptions[i].mask, false)) exception_view(u, i, &sent_header); } } diff --git a/src/core/os_sgline.c b/src/core/os_sgline.c index 9bea10147..e75b256a4 100644 --- a/src/core/os_sgline.c +++ b/src/core/os_sgline.c @@ -222,7 +222,7 @@ class CommandOSSGLine : public Command for (i = 0; i < sglines.count; ++i) { amask = (static_cast<SXLine *>(sglines.list[i]))->mask; - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) sgline_list(i + 1, static_cast<SXLine *>(sglines.list[i]), u, &sent_header); } @@ -265,7 +265,7 @@ class CommandOSSGLine : public Command for (i = 0; i < sglines.count; ++i) { amask = (static_cast<SXLine *>(sglines.list[i]))->mask; - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) sgline_view(i + 1, static_cast<SXLine *>(sglines.list[i]), u, &sent_header); } diff --git a/src/core/os_sqline.c b/src/core/os_sqline.c index a1603008e..1f06c3174 100644 --- a/src/core/os_sqline.c +++ b/src/core/os_sqline.c @@ -209,7 +209,7 @@ class CommandOSSQLine : public Command for (i = 0; i < sqlines.count; ++i) { amask = (static_cast<SXLine *>(sqlines.list[i]))->mask; - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) sqline_list(i + 1, static_cast<SXLine *>(sqlines.list[i]), u, &sent_header); } @@ -252,7 +252,7 @@ class CommandOSSQLine : public Command for (i = 0; i < sqlines.count; ++i) { amask = (static_cast<SXLine *>(sqlines.list[i]))->mask; - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) sqline_view(i + 1, static_cast<SXLine *>(sqlines.list[i]), u, &sent_header); } diff --git a/src/core/os_szline.c b/src/core/os_szline.c index 406db111f..9ca16a127 100644 --- a/src/core/os_szline.c +++ b/src/core/os_szline.c @@ -210,7 +210,7 @@ class CommandOSSZLine : public Command for (i = 0; i < szlines.count; ++i) { amask = (static_cast<SXLine *>(szlines.list[i]))->mask; - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) szline_list(i + 1, static_cast<SXLine *>(szlines.list[i]), u, &sent_header); } @@ -251,7 +251,7 @@ class CommandOSSZLine : public Command for (i = 0; i < szlines.count; ++i) { amask = (static_cast<SXLine *>(szlines.list[i]))->mask; - if (!stricmp(mask, amask) || match_wild_nocase(mask, amask)) + if (!stricmp(mask, amask) || Anope::Match(mask, amask, false)) szline_view(i + 1, static_cast<SXLine *>(szlines.list[i]), u, &sent_header); } diff --git a/src/core/os_userlist.c b/src/core/os_userlist.c index 7d85e641c..5d6bb2504 100644 --- a/src/core/os_userlist.c +++ b/src/core/os_userlist.c @@ -63,7 +63,7 @@ class CommandOSUserList : public Command if (pattern) { snprintf(mask, sizeof(mask), "%s!%s@%s", u2->nick, u2->GetIdent().c_str(), u2->GetDisplayedHost().c_str()); - if (!match_wild_nocase(pattern, mask)) + if (!Anope::Match(pattern, mask, false)) continue; if (modes && !(u2->mode & modes)) continue; |
