From 15bb7656a53d28003aebc8a829cdd9a025f2e9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 10 Aug 2014 13:54:24 +0200 Subject: [PATCH] core: remove dead assignment in function hook_command_exec --- src/core/wee-hook.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index a72324833..0d9f9d3a6 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -674,12 +674,9 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, if (!buffer || !string || !string[0]) return -1; - rc = hook_command_run_exec (buffer, string); - if (rc == WEECHAT_RC_OK_EAT) + if (hook_command_run_exec (buffer, string) == WEECHAT_RC_OK_EAT) return 1; - rc = -1; - argv = string_split (string, " ", 0, 0, &argc); if (argc == 0) { @@ -726,12 +723,9 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, ptr_hook = next_hook; } - if (!hook_plugin && !hook_other_plugin) - { - /* command not found at all */ - rc = -1; - } - else + rc = -1; + + if (hook_plugin || hook_other_plugin) { if (!hook_plugin && (count_other_plugin > 1) && (hook_other_plugin->priority == hook_other_plugin2->priority))