From 6e24ac82ed5d87e98821a6af4c795f53f1958ac0 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 3 Nov 2001 13:16:36 +0000 Subject: Commands that accepeted * parameter as active channel didn't work properly - active channel was used but the * wasn't removed from parameters. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1961 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/commands.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/commands.c b/src/core/commands.c index 1dedc543..daea0ea3 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -639,10 +639,14 @@ static char *get_optional_channel(WI_ITEM_REC *active_item, char **data) origtmp = tmp = g_strdup(*data); channel = cmd_get_param(&tmp); - if (strcmp(channel, "*") == 0 || - !server_ischannel(active_item->server, channel)) + if (strcmp(channel, "*") == 0) { + /* "*" means active channel */ + cmd_get_param(data); ret = active_item->name; - else { + } else if (!server_ischannel(active_item->server, channel)) { + /* we don't have channel parameter - use active channel */ + ret = active_item->name; + } else { /* Find the channel first and use it's name if found. This allows automatic !channel -> !XXXXXchannel replaces. */ channel = cmd_get_param(data); -- cgit v1.2.3