From 1700a27619c0f2954b75db05d9b576d6847d466f Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Thu, 22 Dec 2011 01:49:21 +0100 Subject: [PATCH] Fix bug #173 - Fix the command parsing errors. --- src/core/commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/commands.c b/src/core/commands.c index 508fa2d..4ba5807 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -295,14 +295,14 @@ struct hub_command* command_parse(struct command_base* cbase, const struct hub_u goto command_parse_cleanup; } + // Setup hub command. + cmd->prefix = strdup(((char*) list_get_first(tokens)) + 1); + // Find a matching command handler handle = command_get_handler(cbase, list_get_first(tokens), user, cmd); if (cmd->status != cmd_status_ok) goto command_parse_cleanup; - // Setup hub command. - cmd->prefix = strdup(((char*) list_get_first(tokens)) + 1); - // Parse arguments cmd->status = command_extract_arguments(cbase, user, handle, tokens, &cmd->args); goto command_parse_cleanup; @@ -382,7 +382,7 @@ static int send_command_syntax_error(struct command_base* cbase, struct hub_user static int send_command_missing_arguments(struct command_base* cbase, struct hub_user* user, struct hub_command* cmd) { struct cbuffer* buf = cbuf_create(512); - cbuf_append_format(buf, "*** Missing argument: See !help !%s\n", cmd->prefix); + cbuf_append_format(buf, "*** Missing argument: See !help %s\n", cmd->prefix); send_message(cbase, user, buf); return 0; }