diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-26 21:51:52 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-26 21:51:52 +0000 |
commit | 384fe680ca20ffc18f166eea30f8b7d9a578ad6d (patch) | |
tree | d221663c66c31e8c8cf2549e00ad1663906e2257 /src | |
parent | 3974c41ecd2f5c9aab82e157eeed8fbddf468701 (diff) |
Fix for bug #70 (only first <disabled:commands> item working properly)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1529 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 13 |
1 files 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))) { |