summaryrefslogtreecommitdiff
path: root/src/core/wee-hook.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-03-02 17:34:49 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-03-02 17:34:49 +0100
commit0543b0ccc7253bd38d5f473c3e1092e2b065b6ec (patch)
tree0ae2d27cddbf087212fdaf8853133c33999172b2 /src/core/wee-hook.c
parent282f786c1a75978ea0ad4399b7740abd6ff6486a (diff)
downloadweechat-0543b0ccc7253bd38d5f473c3e1092e2b065b6ec.zip
Add new option weechat.look.command_chars, add functions string_is_command_char and string_input_for_buffer in plugin and script API
Diffstat (limited to 'src/core/wee-hook.c')
-rw-r--r--src/core/wee-hook.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c
index fc298e226..8286e72b1 100644
--- a/src/core/wee-hook.c
+++ b/src/core/wee-hook.c
@@ -572,7 +572,7 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
{
struct t_hook *ptr_hook, *next_hook;
struct t_hook *hook_for_plugin, *hook_for_other_plugin;
- char **argv, **argv_eol;
+ char **argv, **argv_eol, *ptr_command_name;
int argc, rc, number_for_other_plugin;
if (!buffer || !string || !string[0])
@@ -592,6 +592,8 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
}
argv_eol = string_split (string, " ", 1, 0, NULL);
+ ptr_command_name = utf8_next_char (argv[0]);
+
hook_exec_start ();
hook_for_plugin = NULL;
@@ -603,8 +605,8 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
next_hook = ptr_hook->next_hook;
if (!ptr_hook->deleted
- && ((argv[0][0] == '/') && (string_strcasecmp (argv[0] + 1,
- HOOK_COMMAND(ptr_hook, command)) == 0)))
+ && (string_strcasecmp (ptr_command_name,
+ HOOK_COMMAND(ptr_hook, command)) == 0))
{
if (ptr_hook->plugin == plugin)
{