Ignore trailing space on slash commands

master
Curtis McEnroe 2018-08-09 17:49:31 -04:00
parent fc113c8ef9
commit dbdf13b51a
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 1 additions and 0 deletions

View File

@ -109,6 +109,7 @@ void input(char *input) {
return; return;
} }
char *command = strsep(&input, " "); char *command = strsep(&input, " ");
if (input && !input[0]) input = NULL;
for (size_t i = 0; i < COMMANDS_LEN; ++i) { for (size_t i = 0; i < COMMANDS_LEN; ++i) {
if (strcasecmp(command, COMMANDS[i].command)) continue; if (strcasecmp(command, COMMANDS[i].command)) continue;
COMMANDS[i].handler(input); COMMANDS[i].handler(input);