diff options
author | Wouter Coekaerts <coekie@irssi.org> | 2004-10-18 14:19:07 +0000 |
---|---|---|
committer | coekie <coekie@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2004-10-18 14:19:07 +0000 |
commit | 99998626641178aa097de2ccf62ffbeceef98150 (patch) | |
tree | cbbc96a72bdd07f686cf690fff51d001fe94abd2 /src/fe-common | |
parent | 9204602326d257a88c7bb5aae52a2c0dee841b08 (diff) | |
download | irssi-99998626641178aa097de2ccf62ffbeceef98150.zip |
Make cmd_window_item_goto use cmd_get_params, so "/WINDOW ITEM GOTO item<space>" (for example) works
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3323 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/core/window-commands.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index fbfacd85..b4c53fb5 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -462,17 +462,24 @@ static void cmd_window_item_goto(const char *data, SERVER_REC *server) { WI_ITEM_REC *item; GSList *tmp; + void *free_arg; + char *target; + + if (!cmd_get_params(data, &free_arg, 1, &target)) + return; - if (is_numeric(data, '\0')) { + if (is_numeric(target, '\0')) { /* change to specified number */ - tmp = g_slist_nth(active_win->items, atoi(data)-1); + tmp = g_slist_nth(active_win->items, atoi(target)-1); item = tmp == NULL ? NULL : tmp->data; } else { - item = window_item_find_window(active_win, server, data); + item = window_item_find_window(active_win, server, target); } if (item != NULL) window_item_set_active(active_win, item); + + cmd_params_free(free_arg); } /* SYNTAX: WINDOW ITEM MOVE <number>|<name> */ |