diff options
author | Timo Sirainen <cras@irssi.org> | 2001-09-08 18:57:09 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-09-08 18:57:09 +0000 |
commit | 5c45593f024cae0411550e898b77d800396f47ec (patch) | |
tree | c905814d47f8bb76d6ba5ddd2cffe400ba75e744 /src/fe-common/core | |
parent | 477e1615afea4cdf3aa5c7ebf467edf35afc5980 (diff) | |
download | irssi-5c45593f024cae0411550e898b77d800396f47ec.zip |
/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
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/window-commands.c | 17 |
1 files 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 (!cmd_get_params(data, &free_arg, 1, &target)) + return; - if (is_numeric(data, '\0')) { + 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] <number> */ |