diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-04-25 15:19:00 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-04-25 15:19:00 +0000 |
commit | 185d28dfb9e0ff934f11cd1ff3a01f1e8b405e38 (patch) | |
tree | 9c3d3ec14bcaaa82db44ba4cadc0f70efbcc22db /src | |
parent | 6f316c732a7de1792be1a14f5a823ed9afd80fb1 (diff) |
- God Damn It; resv exempts should be working now
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1860 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/resv.c | 39 |
1 files changed, 19 insertions, 20 deletions
@@ -53,6 +53,7 @@ dlink_list resv_channel_list = { NULL, NULL, 0 }; struct MaskItem * create_resv(const char *name, const char *reason, const dlink_list *list) { + dlink_node *ptr = NULL; struct MaskItem *conf = NULL; enum maskitem_type type; @@ -73,27 +74,25 @@ create_resv(const char *name, const char *reason, const dlink_list *list) if (list) { - if (strlen(name) == 2 && IsAlpha(*(name + 1) && IsAlpha(*(name + 2)))) + DLINK_FOREACH(ptr, list->head) { - struct exempt *exptr = MyMalloc(sizeof(*exptr)); - - exptr->name = xstrdup(name); - exptr->coid = GeoIP_id_by_code(name); - dlinkAdd(exptr, &exptr->node, &conf->exempt_list); - } - else - { - dlink_node *ptr = NULL; - - DLINK_FOREACH(ptr, list->head) + char nick[NICKLEN + 1]; + char user[USERLEN + 1]; + char host[HOSTLEN + 1]; + struct split_nuh_item nuh; + struct exempt *exptr = NULL; + char *s = ptr->data; + + if (strlen(s) == 2 && IsAlpha(*(s + 1) && IsAlpha(*(s + 2)))) { - char nick[NICKLEN + 1]; - char user[USERLEN + 1]; - char host[HOSTLEN + 1]; - struct split_nuh_item nuh; - struct exempt *exptr = NULL; - - nuh.nuhmask = name; + exptr = MyMalloc(sizeof(*exptr)); + exptr->name = xstrdup(s); + exptr->coid = GeoIP_id_by_code(s); + dlinkAdd(exptr, &exptr->node, &conf->exempt_list); + } + else + { + nuh.nuhmask = s; nuh.nickptr = nick; nuh.userptr = user; nuh.hostptr = host; @@ -105,7 +104,7 @@ create_resv(const char *name, const char *reason, const dlink_list *list) split_nuh(&nuh); exptr = MyMalloc(sizeof(*exptr)); - exptr->name = xstrdup(name); + exptr->name = xstrdup(nick); exptr->user = xstrdup(user); exptr->host = xstrdup(host); exptr->type = parse_netmask(host, &exptr->addr, &exptr->bits); |