]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix for bug #70 (only first <disabled:commands> item working properly)
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 26 May 2005 21:51:52 +0000 (21:51 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 26 May 2005 21:51:52 +0000 (21:51 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1529 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd.cpp

index 63dbe389613a4268337805a759fc7203f7c3c0c2..dc6d17304721b1ac270d99f6befa8ae019ab97d3 100644 (file)
@@ -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)))
                                        {