1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

/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
This commit is contained in:
Timo Sirainen 2001-09-08 18:57:09 +00:00 committed by cras
parent 477e1615af
commit 5c45593f02

View File

@ -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, static void cmd_window_item_move(const char *data, SERVER_REC *server,
WI_ITEM_REC *item) 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 */ /* move current window item to specified window */
window = window_find_refnum(atoi(data)); window = window_find_refnum(atoi(target));
} else { } else {
/* move specified window item to current window */ /* move specified window item to current window */
item = window_item_find(server, data); item = window_item_find(server, target);
window = active_win; window = active_win;
} }
if (window != NULL && item != NULL) 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] <number> */ /* SYNTAX: WINDOW NUMBER [-sticky] <number> */