diff options
author | Timo Sirainen <cras@irssi.org> | 2002-10-14 11:39:36 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-10-14 11:39:36 +0000 |
commit | 7c11b314eb4113f0f37501d9e516a10812585af5 (patch) | |
tree | 333468ee89d5069e8fa11b381b552f3227622bc5 /src/fe-common/core | |
parent | 7d5ee9db1f8a77e0301119cf6337229dd4833804 (diff) | |
download | irssi-7c11b314eb4113f0f37501d9e516a10812585af5.zip |
/UNQUERY and /WINDOW GOTO now ignores trailing whitespace
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2942 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/fe-queries.c | 18 | ||||
-rw-r--r-- | src/fe-common/core/window-commands.c | 11 |
2 files changed, 21 insertions, 8 deletions
diff --git a/src/fe-common/core/fe-queries.c b/src/fe-common/core/fe-queries.c index 762aa034..8345d52f 100644 --- a/src/fe-common/core/fe-queries.c +++ b/src/fe-common/core/fe-queries.c @@ -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>] */ diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index f3e56a90..a8f3bb10 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -280,6 +280,8 @@ static WINDOW_REC *window_highest_activity(WINDOW_REC *window) static void cmd_window_goto(const char *data) { WINDOW_REC *window; + char *target; + void *free_arg; g_return_if_fail(data != NULL); @@ -288,13 +290,18 @@ static void cmd_window_goto(const char *data) return; } - if (g_strcasecmp(data, "active") == 0) + if (!cmd_get_params(data, &free_arg, 1, &target)) + return; + + if (g_strcasecmp(target, "active") == 0) window = window_highest_activity(active_win); else - window = window_find_item(active_win->active_server, data); + window = window_find_item(active_win->active_server, target); if (window != NULL) window_set_active(window); + + cmd_params_free(free_arg); } /* SYNTAX: WINDOW NEXT */ |