1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: limit hook_command_run to the exact given command (when no "*" are in command hook)

This commit is contained in:
Sébastien Helleu
2017-05-31 19:51:57 +02:00
parent dc60f343ba
commit 77cefb7621
+6 -3
View File
@@ -1013,9 +1013,12 @@ hook_command_run_exec (struct t_gui_buffer *buffer, const char *command)
if (!hook_matching
&& !strchr (HOOK_COMMAND_RUN(ptr_hook, command), ' '))
{
hook_matching = (string_strncasecmp (ptr_command,
HOOK_COMMAND_RUN(ptr_hook, command),
utf8_strlen (HOOK_COMMAND_RUN(ptr_hook, command))) == 0);
length = strlen (HOOK_COMMAND_RUN(ptr_hook, command));
hook_matching = ((string_strncasecmp (ptr_command,
HOOK_COMMAND_RUN(ptr_hook, command),
utf8_strlen (HOOK_COMMAND_RUN(ptr_hook, command))) == 0)
&& ((ptr_command[length] == ' ')
|| (ptr_command[length] == '\0')));
}
if (hook_matching)