From 384fe680ca20ffc18f166eea30f8b7d9a578ad6d Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 26 May 2005 21:51:52 +0000 Subject: [PATCH] Fix for bug #70 (only first item working properly) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1529 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 63dbe3896..dc6d17304 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2042,21 +2042,18 @@ void process_command(userrec *user, char* cmd) } if ((user->registered == 7) && (!strchr(user->modes,'o'))) { - char* mycmd; - char* savept2; - mycmd = strtok_r(DisabledCommands," ",&savept2); - while (mycmd) + std::stringstream dcmds(DisabledCommands); + while (!dcmds.eof()) { - if (!strcasecmp(mycmd,command)) + std::string thiscmd; + dcmds >> thiscmd; + if (!strcasecmp(thiscmd.c_str(),command)) { // command is disabled! WriteServ(user->fd,"421 %s %s :This command has been disabled.",user->nick,command); return; } - mycmd = strtok_r(NULL," ",&savept2); } - - } if ((user->registered == 7) || (!strncmp(command,"USER",4)) || (!strncmp(command,"NICK",4)) || (!strncmp(command,"PASS",4))) { -- 2.39.5