Modify SET command to accept space-separated values

In preparation for nick_blacklist, which needs to allow input of a
space-separated list of nicks to ignore, the SET command shouldn't be
requirement an exact number of tokens.  Any tokens past the first three
should be included in the option's new value, such that a command like
"set nick_blacklist nick1 nick2 nick3" will be accepted.
This commit is contained in:
John Reese 2011-01-18 10:44:23 -05:00
parent 54f9607f0d
commit 6fb80cff1f
1 changed files with 2 additions and 2 deletions

View File

@ -376,14 +376,14 @@ class CNotifoMod : public CModule
// SET command // SET command
if (action == "set") if (action == "set")
{ {
if (token_count != 3) if (token_count < 3)
{ {
PutModule("Usage: set <option> <value>"); PutModule("Usage: set <option> <value>");
return; return;
} }
CString option = tokens[1].AsLower(); CString option = tokens[1].AsLower();
CString value = tokens[2]; CString value = command.Token(2, true, " ");
MCString::iterator pos = options.find(option); MCString::iterator pos = options.find(option);
if (pos == options.end()) if (pos == options.end())