1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 03:03:12 +02:00

Increase number of authorized calls to same command (recursive calls), from 1 to 5 (more than 5 is considered as looping)

This commit is contained in:
Sebastien Helleu
2008-05-22 12:55:37 +02:00
parent ec6f2c2e17
commit a4a4e5126c
10 changed files with 54 additions and 50 deletions
+6 -5
View File
@@ -417,9 +417,10 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
&& ((argv[0][0] == '/') && (string_strcasecmp (argv[0] + 1,
HOOK_COMMAND(ptr_hook, command)) == 0)))
{
if (ptr_hook->running)
command_is_running = 1;
else
if (ptr_hook->running > 0)
command_is_running = ptr_hook->running;
if (ptr_hook->running < HOOK_COMMAND_MAX_CALLS)
{
if (ptr_hook->plugin == plugin)
{
@@ -452,10 +453,10 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin,
if (ptr_hook)
{
ptr_hook->running = 1;
ptr_hook->running++;
rc = (int) (HOOK_COMMAND(ptr_hook, callback))
(ptr_hook->callback_data, buffer, argc, argv, argv_eol);
ptr_hook->running = 0;
ptr_hook->running--;
if (rc == WEECHAT_RC_ERROR)
rc = 0;
else