mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
rmodifier: prohibit names beginning with "#" for rmodifiers
This commit is contained in:
@@ -242,6 +242,8 @@ rmodifier_command_init ()
|
||||
"listdefault: list default rmodifiers\n"
|
||||
" add: add a rmodifier\n"
|
||||
" name: name of rmodifier\n"
|
||||
" note: the name can not start with "
|
||||
"\"#\"\n"
|
||||
" modifiers: comma separated list of modifiers\n"
|
||||
" groups: action on groups found: comma separated "
|
||||
"list of groups (from 1 to 9) with optional \"*\" "
|
||||
|
||||
@@ -263,9 +263,11 @@ rmodifier_new (const char *name, const char *modifiers, const char *str_regex,
|
||||
struct t_rmodifier *new_rmodifier, *ptr_rmodifier;
|
||||
regex_t *regex;
|
||||
|
||||
if (!name || !name[0] || !modifiers || !modifiers[0]
|
||||
if (!name || !name[0] || (name[0] == '#') || !modifiers || !modifiers[0]
|
||||
|| !str_regex || !str_regex[0])
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
regex = malloc (sizeof (*regex));
|
||||
if (!regex)
|
||||
|
||||
Reference in New Issue
Block a user