/UNQUERY and /WINDOW GOTO now ignores trailing whitespace

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2942 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-10-14 11:39:36 +00:00 committed by cras
commit 7c11b314eb
2 changed files with 21 additions and 8 deletions

View file

@ -194,23 +194,29 @@ static void cmd_window_server(const char *data)
static void cmd_unquery(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
QUERY_REC *query;
char *nick;
void *free_arg;
g_return_if_fail(data != NULL);
if (*data == '\0') {
if (!cmd_get_params(data, &free_arg, 1, &nick))
return;
if (*nick == '\0') {
/* remove current query */
query = QUERY(item);
if (query == NULL) return;
} else {
query = query_find(server, data);
query = query_find(server, nick);
if (query == NULL) {
printformat(server, NULL, MSGLEVEL_CLIENTERROR,
TXT_NO_QUERY, data);
return;
TXT_NO_QUERY, nick);
}
}
query_destroy(query);
if (query != NULL)
query_destroy(query);
cmd_params_free(free_arg);
}
/* SYNTAX: QUERY [-window] [-<server tag>] <nick> [<message>] */