From 9e1aba8cec3fabb7a9bea9d92c86180857b6fe61 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 28 Nov 2001 21:38:35 +0000 Subject: [PATCH] /QUERY without a parameter but with options (eg. /alias query query -window) now does the same /UNQUERY properly. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2162 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-queries.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fe-common/core/fe-queries.c b/src/fe-common/core/fe-queries.c index 2f4e1ec1..9be07fce 100644 --- a/src/fe-common/core/fe-queries.c +++ b/src/fe-common/core/fe-queries.c @@ -197,17 +197,17 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item) g_return_if_fail(data != NULL); - if (*data == '\0') { - /* remove current query */ - cmd_unquery("", server, item); - return; - } - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | PARAM_FLAG_OPTIONS | PARAM_FLAG_UNKNOWN_OPTIONS, "query", &optlist, &nick, &msg)) return; - if (*nick == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); + + if (*nick == '\0') { + /* remove current query */ + cmd_unquery("", server, item); + cmd_params_free(free_arg); + return; + } server = cmd_options_get_server("query", optlist, server); if (server == NULL) {