diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/plugin-script-api.c | 55 |
1 files changed, 5 insertions, 50 deletions
diff --git a/src/plugins/plugin-script-api.c b/src/plugins/plugin-script-api.c index 1354042b9..b8ce32176 100644 --- a/src/plugins/plugin-script-api.c +++ b/src/plugins/plugin-script-api.c @@ -71,8 +71,11 @@ plugin_script_api_config_new (struct t_weechat_plugin *weechat_plugin, script, function_and_data); - if (!new_config_file && function_and_data) - free (function_and_data); + if (!new_config_file) + { + if (function_and_data) + free (function_and_data); + } return new_config_file; } @@ -376,9 +379,6 @@ plugin_script_api_hook_command (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_command (command, description, args, @@ -418,9 +418,6 @@ plugin_script_api_hook_command_run (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_command_run (command, @@ -458,9 +455,6 @@ plugin_script_api_hook_timer (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_timer (interval, align_second, max_calls, @@ -499,9 +493,6 @@ plugin_script_api_hook_fd (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_fd (fd, flag_read, flag_write, flag_exception, @@ -544,9 +535,6 @@ plugin_script_api_hook_process_hashtable (struct t_weechat_plugin *weechat_plugi char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_process_hashtable (command, options, timeout, @@ -619,9 +607,6 @@ plugin_script_api_hook_connect (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_connect (proxy, address, port, ipv6, retry, @@ -669,9 +654,6 @@ plugin_script_api_hook_print (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_print (buffer, tags, message, strip_colors, @@ -711,9 +693,6 @@ plugin_script_api_hook_signal (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_signal (signal, callback, script, @@ -752,9 +731,6 @@ plugin_script_api_hook_hsignal (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_hsignal (signal, callback, script, @@ -793,9 +769,6 @@ plugin_script_api_hook_config (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_config (option, callback, script, @@ -836,9 +809,6 @@ plugin_script_api_hook_completion (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_completion (completion, description, @@ -878,9 +848,6 @@ plugin_script_api_hook_modifier (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_modifier (modifier, @@ -921,9 +888,6 @@ plugin_script_api_hook_info (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_info (info_name, description, args_description, @@ -965,9 +929,6 @@ plugin_script_api_hook_info_hashtable (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_info_hashtable (info_name, description, @@ -1013,9 +974,6 @@ plugin_script_api_hook_infolist (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_infolist (infolist_name, description, @@ -1054,9 +1012,6 @@ plugin_script_api_hook_focus (struct t_weechat_plugin *weechat_plugin, char *function_and_data; struct t_hook *new_hook; - if (!function || !function[0]) - return NULL; - function_and_data = plugin_script_build_function_and_data (function, data); new_hook = weechat_hook_focus (area, callback, script, function_and_data); |