From 0bb5b62bfb18d033ef03932f6ea8fe7a366c1b92 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 9 Jul 2006 22:14:26 +0000 Subject: Added Spacify() function local to cmd_whois.cpp which translates _ in oper names to " " git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4254 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_whois.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/cmd_whois.cpp') diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp index 4caf0b783..138589237 100644 --- a/src/cmd_whois.cpp +++ b/src/cmd_whois.cpp @@ -30,6 +30,16 @@ extern ModuleList modules; extern FactoryList factory; extern time_t TIME; +const char* Spacify(char* n) +{ + static char x[MAXBUF]; + strlcpy(x,n,MAXBUF); + for (char* y = x; *y; y++) + if (*y == '_') + *y = ' '; + return x; +} + void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long idle, const char* nick) { // bug found by phidjit - were able to whois an incomplete connection if it had sent a NICK or USER @@ -66,7 +76,7 @@ void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long i } if (*dest->oper) { - WriteServ(user->fd,"313 %s %s :is %s %s on %s",user->nick, dest->nick, (strchr("AEIOUaeiou",*dest->oper) ? "an" : "a"),dest->oper, Config->Network); + WriteServ(user->fd,"313 %s %s :is %s %s on %s",user->nick, dest->nick, (strchr("AEIOUaeiou",*dest->oper) ? "an" : "a"),Spacify(dest->oper), Config->Network); } if ((!signon) && (!idle)) { -- cgit v1.2.3