diff --git a/src/core/commands.c b/src/core/commands.c index a96b5fa0..0899c9fa 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -717,7 +717,8 @@ int cmd_get_params(const char *data, gpointer *free_me, int count, ...) cnt = PARAM_WITHOUT_FLAGS(count); if (count & PARAM_FLAG_OPTCHAN) { /* optional channel as first parameter */ - require_name = (count & PARAM_FLAG_OPTCHAN_NAME); + require_name = (count & PARAM_FLAG_OPTCHAN_NAME) == + PARAM_FLAG_OPTCHAN_NAME; arg = get_optional_channel(item, &datad, require_name); str = (char **) va_arg(args, char **); diff --git a/src/core/commands.h b/src/core/commands.h index 3e55a2ad..e3bf4374 100644 --- a/src/core/commands.h +++ b/src/core/commands.h @@ -136,7 +136,7 @@ int command_have_option(const char *cmd, const char *option); /* optional channel in first argument */ #define PARAM_FLAG_OPTCHAN 0x00010000 /* optional channel in first argument, but don't treat "*" as current channel */ -#define PARAM_FLAG_OPTCHAN_NAME 0x00030000 +#define PARAM_FLAG_OPTCHAN_NAME (0x00020000|PARAM_FLAG_OPTCHAN) char *cmd_get_param(char **data); /* get parameters from command - you should point free_me somewhere and