From 39b23540e348ab2b6e59913b339498941456d68c Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 7 May 2009 23:58:32 +0200 Subject: [PATCH] Stop changing \s to spaces in masktrace and testmask, match_esc() handles \s directly now. --- modules/m_etrace.c | 40 +--------------------------------------- modules/m_testmask.c | 36 ++---------------------------------- 2 files changed, 3 insertions(+), 73 deletions(-) diff --git a/modules/m_etrace.c b/modules/m_etrace.c index a0a1e072..9441a0ee 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -288,45 +288,7 @@ match_masktrace(struct Client *source_p, rb_dlink_list *list, struct Client *target_p; rb_dlink_node *ptr; const char *sockhost; - char *mangle_gecos = NULL; - if(gecos != NULL) - { - if(strstr(gecos, "\\s")) - { - char *tmp = LOCAL_COPY(gecos); - char *orig = tmp; - char *new = tmp; - while(*orig) - { - if(*orig == '\\' && *(orig + 1) != '\0') - { - if(*(orig + 1) == 's') - { - *new++ = ' '; - orig += 2; - } - /* otherwise skip that and the escaped - * character after it, so we dont mistake - * \\s as \s --fl - */ - else - { - *new++ = *orig++; - *new++ = *orig++; - } - } - else - *new++ = *orig++; - } - - *new = '\0'; - mangle_gecos = LOCAL_COPY(tmp); - } - else - mangle_gecos = LOCAL_COPY(gecos); - } - RB_DLINK_FOREACH(ptr, list->head) { target_p = ptr->data; @@ -348,7 +310,7 @@ match_masktrace(struct Client *source_p, rb_dlink_list *list, if(name != NULL && !match(name, target_p->name)) continue; - if(mangle_gecos != NULL && !match_esc(mangle_gecos, target_p->info)) + if(gecos != NULL && !match_esc(gecos, target_p->info)) continue; sendto_one(source_p, form_str(RPL_ETRACE), diff --git a/modules/m_testmask.c b/modules/m_testmask.c index 373193df..304afab0 100644 --- a/modules/m_testmask.c +++ b/modules/m_testmask.c @@ -71,7 +71,7 @@ mo_testmask(struct Client *client_p, struct Client *source_p, int gcount = 0; char *name, *username, *hostname; const char *sockhost; - char *gecos = NULL, *mangle_gecos = NULL; + char *gecos = NULL; rb_dlink_node *ptr; name = LOCAL_COPY(parv[1]); @@ -105,38 +105,6 @@ mo_testmask(struct Client *client_p, struct Client *source_p, { gecos = LOCAL_COPY(parv[2]); collapse_esc(gecos); - if(strstr(gecos, "\\s")) - { - char *tmp = LOCAL_COPY(gecos); - char *orig = tmp; - char *new = tmp; - while(*orig) - { - if(*orig == '\\' && *(orig + 1) != '\0') - { - if(*(orig + 1) == 's') - { - *new++ = ' '; - orig += 2; - } - /* otherwise skip that and the escaped - * character after it, so we dont mistake - * \\s as \s --fl - */ - else - { - *new++ = *orig++; - *new++ = *orig++; - } - } - else - *new++ = *orig++; - } - - *new = '\0'; - mangle_gecos = LOCAL_COPY(tmp); - } else - mangle_gecos = gecos; } RB_DLINK_FOREACH(ptr, global_client_list.head) @@ -161,7 +129,7 @@ mo_testmask(struct Client *client_p, struct Client *source_p, if(name && !match(name, target_p->name)) continue; - if(mangle_gecos && !match_esc(mangle_gecos, target_p->info)) + if(gecos && !match_esc(gecos, target_p->info)) continue; if(MyClient(target_p))