From: brain Date: Thu, 26 May 2005 21:51:52 +0000 (+0000) Subject: Fix for bug #70 (only first item working properly) X-Git-Tag: v2.0.23~10166 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=384fe680ca20ffc18f166eea30f8b7d9a578ad6d;p=user%2Fhenk%2Fcode%2Finspircd.git 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 --- 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))) {