From 5c45593f024cae0411550e898b77d800396f47ec Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 8 Sep 2001 18:57:09 +0000 Subject: [PATCH] /WINDOW ITEM MOVE didn't work properly if there was space after parameter (..which tab-completion added..) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1779 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/window-commands.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index c4107798..fe5fefc6 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -408,18 +408,25 @@ static void cmd_window_item_goto(const char *data, SERVER_REC *server) static void cmd_window_item_move(const char *data, SERVER_REC *server, WI_ITEM_REC *item) { - WINDOW_REC *window; + WINDOW_REC *window; + void *free_arg; + char *target; - if (is_numeric(data, '\0')) { + if (!cmd_get_params(data, &free_arg, 1, &target)) + return; + + if (is_numeric(target, '\0')) { /* move current window item to specified window */ - window = window_find_refnum(atoi(data)); + window = window_find_refnum(atoi(target)); } else { /* move specified window item to current window */ - item = window_item_find(server, data); + item = window_item_find(server, target); window = active_win; } if (window != NULL && item != NULL) - window_item_set_active(window, item); + window_item_set_active(window, item); + + cmd_params_free(free_arg); } /* SYNTAX: WINDOW NUMBER [-sticky] */