From 687672c92fac0cb4e91f400d74069cbdfe8f7e9a Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 22 Dec 2011 00:31:49 +0100 Subject: [PATCH] fixed cmd_linker output for empty subcommand list --- src/modcmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modcmd.c b/src/modcmd.c index aca47f6..6f0ade7 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -163,6 +163,8 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s struct cmd_binding *cbind; for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) { if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && stricmp(cbind->cmd, message) == 0) { + //get a text bot + tmp_text_client = get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0)); if(cbind->func->func == modcmd_linker) { //links subcommands char command[MAXLEN]; @@ -191,7 +193,7 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s subcompos += sprintf(subcommands + subcompos, (subcompos ? ", %s" : "%s"), cbind->cmd + commandlen); } } - reply(tmp_text_client, user, "MODCMD_SUBCOMMANDS", parent_bind->cmd, subcommands); + reply(tmp_text_client, user, "MODCMD_SUBCOMMANDS", parent_bind->cmd, (subcompos ? subcommands : "none")); break; } } @@ -204,8 +206,6 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s break; chan = sent_chan; } - //get a text bot - tmp_text_client = get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0)); //parse the arguments... char *arga[MAXNUMPARAMS]; char **argv; -- 2.20.1