1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +02:00

api: add special value - (hyphen-minus) in options of function command_options to prevent execution of commands (issue #2199)

This commit is contained in:
Sébastien Helleu
2024-10-13 10:51:33 +02:00
parent 709b2b5796
commit bca7c7438a
8 changed files with 60 additions and 25 deletions
+14 -3
View File
@@ -327,9 +327,20 @@ input_data (struct t_gui_buffer *buffer, const char *data,
}
else
{
/* execute command on buffer */
rc = input_exec_command (buffer, 1, buffer->plugin, ptr_data,
commands_allowed);
/*
* if commands_allowed has special value "-", send data as-is
* to the buffer input callback, otherwise execute the command
* on the buffer
*/
if (commands_allowed && (strcmp (commands_allowed, "-") == 0))
{
rc = input_exec_data (buffer, ptr_data);
}
else
{
rc = input_exec_command (buffer, 1, buffer->plugin,
ptr_data, commands_allowed);
}
}
}