diff options
Diffstat (limited to 'src/plugins')
32 files changed, 65 insertions, 135 deletions
diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c index 73f8d8a8d..d74c77d7a 100644 --- a/src/plugins/alias/alias.c +++ b/src/plugins/alias/alias.c @@ -283,8 +283,7 @@ alias_replace_args (const char *alias_args, const char *user_args) if (pos > start) weechat_string_dyn_concat (result, start, -1); - if (argv) - weechat_string_free_split (argv); + weechat_string_free_split (argv); return weechat_string_dyn_free (result, 0); } diff --git a/src/plugins/exec/exec-buffer.c b/src/plugins/exec/exec-buffer.c index 3e4cd3e66..0ac48fc27 100644 --- a/src/plugins/exec/exec-buffer.c +++ b/src/plugins/exec/exec-buffer.c @@ -68,10 +68,8 @@ exec_buffer_input_cb (const void *pointer, void *data, if (argv && argv_eol) exec_command_run (buffer, argc, argv, argv_eol, 0); - if (argv) - weechat_string_free_split (argv); - if (argv_eol) - weechat_string_free_split (argv_eol); + weechat_string_free_split (argv); + weechat_string_free_split (argv_eol); return WEECHAT_RC_OK; } diff --git a/src/plugins/exec/exec-config.c b/src/plugins/exec/exec-config.c index 01a00fd70..2357cf053 100644 --- a/src/plugins/exec/exec-config.c +++ b/src/plugins/exec/exec-config.c @@ -63,9 +63,7 @@ exec_config_change_command_default_options (const void *pointer, void *data, (void) data; (void) option; - if (exec_config_cmd_options) - weechat_string_free_split (exec_config_cmd_options); - + weechat_string_free_split (exec_config_cmd_options); exec_config_cmd_options = weechat_string_split ( weechat_config_string (exec_config_command_default_options), " ", diff --git a/src/plugins/fset/fset-command.c b/src/plugins/fset/fset-command.c index a24b9da7e..bf47275d7 100644 --- a/src/plugins/fset/fset-command.c +++ b/src/plugins/fset/fset-command.c @@ -591,9 +591,7 @@ fset_command_run_set_cb (const void *pointer, void *data, } end: - if (argv) - weechat_string_free_split (argv); - + weechat_string_free_split (argv); return rc; } diff --git a/src/plugins/fset/fset-completion.c b/src/plugins/fset/fset-completion.c index 17ead144d..0da118f89 100644 --- a/src/plugins/fset/fset-completion.c +++ b/src/plugins/fset/fset-completion.c @@ -96,8 +96,7 @@ fset_completion_option_cb (const void *pointer, void *data, completion, words[i], 0, WEECHAT_LIST_POS_SORT); } } - if (words) - weechat_string_free_split (words); + weechat_string_free_split (words); ptr_option = weechat_hdata_move (fset_hdata_config_option, ptr_option, 1); } diff --git a/src/plugins/fset/fset-config.c b/src/plugins/fset/fset-config.c index 76c4c962c..dbff08b8c 100644 --- a/src/plugins/fset/fset-config.c +++ b/src/plugins/fset/fset-config.c @@ -142,9 +142,7 @@ fset_config_change_auto_refresh_cb (const void *pointer, void *data, (void) data; (void) option; - if (fset_config_auto_refresh) - weechat_string_free_split (fset_config_auto_refresh); - + weechat_string_free_split (fset_config_auto_refresh); fset_config_auto_refresh = weechat_string_split ( weechat_config_string (fset_config_look_auto_refresh), ",", @@ -206,9 +204,7 @@ fset_config_change_sort_cb (const void *pointer, void *data, (void) data; (void) option; - if (fset_config_sort_fields) - weechat_string_free_split (fset_config_sort_fields); - + weechat_string_free_split (fset_config_sort_fields); fset_config_sort_fields = weechat_string_split ( weechat_config_string (fset_config_look_sort), ",", diff --git a/src/plugins/irc/irc-batch.c b/src/plugins/irc/irc-batch.c index a2346f8d7..b3ed06e64 100644 --- a/src/plugins/irc/irc-batch.c +++ b/src/plugins/irc/irc-batch.c @@ -456,8 +456,7 @@ irc_batch_process_multiline (struct t_irc_server *server, end: weechat_hashtable_free (hash_tags); - if (list_messages) - weechat_string_free_split (list_messages); + weechat_string_free_split (list_messages); return weechat_string_dyn_free (result, 0); } @@ -500,8 +499,7 @@ irc_batch_modifier_cb (const void *pointer, void *data, result = irc_batch_process_multiline (ptr_server, string, items[2]); } } - if (items) - weechat_string_free_split (items); + weechat_string_free_split (items); return (result) ? result : strdup (string); } diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 8c92d77ac..c4d263165 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -919,8 +919,7 @@ irc_color_decode_ansi_cb (void *data, const char *text) } end: - if (items) - weechat_string_free_split (items); + weechat_string_free_split (items); free (text2); return (output) ? output : strdup (""); diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index b8f2099cc..663234ef9 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -705,8 +705,7 @@ irc_command_exec_all_channels (struct t_irc_server *server, irc_command_exec_buffers (list_buffers, command); weechat_list_free (list_buffers); - if (channels) - weechat_string_free_split (channels); + weechat_string_free_split (channels); } /* @@ -931,8 +930,7 @@ irc_command_exec_all_servers (int inclusive, const char *str_servers, const char irc_command_exec_buffers (list_buffers, command); weechat_list_free (list_buffers); - if (servers) - weechat_string_free_split (servers); + weechat_string_free_split (servers); } /* @@ -1465,10 +1463,8 @@ irc_command_run_away (const void *pointer, void *data, irc_command_away (pointer, data, buffer, argc, argv, argv_eol); } - if (argv) - weechat_string_free_split (argv); - if (argv_eol) - weechat_string_free_split (argv_eol); + weechat_string_free_split (argv); + weechat_string_free_split (argv_eol); return WEECHAT_RC_OK; } @@ -3002,8 +2998,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments, weechat_string_free_split (channels); } - if (keys) - weechat_string_free_split (keys); + weechat_string_free_split (keys); } /* diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index b96235348..a09bceac8 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -1219,12 +1219,9 @@ irc_config_check_autojoin (const char *autojoin) end: free (string); - if (items) - weechat_string_free_split (items); - if (channels) - weechat_string_free_split (channels); - if (keys) - weechat_string_free_split (keys); + weechat_string_free_split (items); + weechat_string_free_split (channels); + weechat_string_free_split (keys); return rc; } @@ -1773,10 +1770,8 @@ irc_config_ignore_read_cb (const void *pointer, void *data, { irc_ignore_new (argv_eol[2], argv[0], argv[1]); } - if (argv) - weechat_string_free_split (argv); - if (argv_eol) - weechat_string_free_split (argv_eol); + weechat_string_free_split (argv); + weechat_string_free_split (argv_eol); } } diff --git a/src/plugins/irc/irc-join.c b/src/plugins/irc/irc-join.c index c9e028a62..9889e40eb 100644 --- a/src/plugins/irc/irc-join.c +++ b/src/plugins/irc/irc-join.c @@ -374,12 +374,9 @@ irc_join_split (struct t_irc_server *server, const char *join, } end: - if (items) - weechat_string_free_split (items); - if (channels) - weechat_string_free_split (channels); - if (keys) - weechat_string_free_split (keys); + weechat_string_free_split (items); + weechat_string_free_split (channels); + weechat_string_free_split (keys); return arraylist; } diff --git a/src/plugins/irc/irc-list.c b/src/plugins/irc/irc-list.c index abef27d57..98e9b994b 100644 --- a/src/plugins/irc/irc-list.c +++ b/src/plugins/irc/irc-list.c @@ -448,8 +448,7 @@ irc_list_parse_messages (struct t_irc_server *server, const char *output) } } free (command); - if (params) - weechat_string_free_split (params); + weechat_string_free_split (params); } weechat_string_free_split (irc_msgs); diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index d908716be..2dc822f1f 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -520,8 +520,7 @@ irc_message_parse_to_hashtable (struct t_irc_server *server, free (channel); free (arguments); free (text); - if (params) - weechat_string_free_split (params); + weechat_string_free_split (params); return hashtable; } @@ -1282,10 +1281,8 @@ irc_message_split_join (struct t_irc_message_split_context *context, msg_to_send + length_no_channel + 1); } - if (channels) - weechat_string_free_split (channels); - if (keys) - weechat_string_free_split (keys); + weechat_string_free_split (channels); + weechat_string_free_split (keys); return 1; } @@ -1828,10 +1825,8 @@ end: } free (tags); - if (argv) - weechat_string_free_split (argv); - if (argv_eol) - weechat_string_free_split (argv_eol); + weechat_string_free_split (argv); + weechat_string_free_split (argv_eol); return split_context.hashtable; } diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c index 09eb0fe71..ea7337266 100644 --- a/src/plugins/irc/irc-mode.c +++ b/src/plugins/irc/irc-mode.c @@ -315,8 +315,7 @@ end: free (new_modes); free (new_args); free (str_modes); - if (argv) - weechat_string_free_split (argv); + weechat_string_free_split (argv); if (channel->modes && (strcmp (channel->modes, "+") == 0)) { free (channel->modes); @@ -562,8 +561,7 @@ irc_mode_channel_set (struct t_irc_server *server, pos++; } - if (argv) - weechat_string_free_split (argv); + weechat_string_free_split (argv); if (channel_modes_updated) weechat_bar_item_update ("buffer_modes"); diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 57dcc9e03..16988abbc 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -6291,8 +6291,7 @@ IRC_PROTOCOL_CALLBACK(353) free (str_params); if (str_nicks) weechat_string_dyn_free (str_nicks, 1); - if (nicks) - weechat_string_free_split (nicks); + weechat_string_free_split (nicks); return WEECHAT_RC_OK; } diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c index 456c03581..0ebdc61d8 100644 --- a/src/plugins/irc/irc-redirect.c +++ b/src/plugins/irc/irc-redirect.c @@ -923,9 +923,7 @@ irc_redirect_message (struct t_irc_server *server, const char *message, } end: - if (arguments_argv) - weechat_string_free_split (arguments_argv); - + weechat_string_free_split (arguments_argv); return rc; } diff --git a/src/plugins/irc/irc-sasl.c b/src/plugins/irc/irc-sasl.c index 75f7e252c..5028794fa 100644 --- a/src/plugins/irc/irc-sasl.c +++ b/src/plugins/irc/irc-sasl.c @@ -431,8 +431,7 @@ end: free (username); free (username2); free (data); - if (attrs) - weechat_string_free_split (attrs); + weechat_string_free_split (attrs); free (nonce_server); free (salt_base64); free (salt); diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 066f11ab3..cfe2cd632 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -2289,8 +2289,7 @@ irc_server_free_data (struct t_irc_server *server) } free (server->name); free (server->addresses_eval); - if (server->addresses_array) - weechat_string_free_split (server->addresses_array); + weechat_string_free_split (server->addresses_array); free (server->ports_array); free (server->retry_array); free (server->current_address); @@ -2302,8 +2301,7 @@ irc_server_free_data (struct t_irc_server *server) weechat_unhook (server->hook_timer_anti_flood); irc_server_free_sasl_data (server); free (server->unterminated_message); - if (server->nicks_array) - weechat_string_free_split (server->nicks_array); + weechat_string_free_split (server->nicks_array); free (server->nick); free (server->nick_modes); free (server->host); @@ -2315,8 +2313,7 @@ irc_server_free_data (struct t_irc_server *server) free (server->chantypes); free (server->chanmodes); free (server->clienttagdeny); - if (server->clienttagdeny_array) - weechat_string_free_split (server->clienttagdeny_array); + weechat_string_free_split (server->clienttagdeny_array); free (server->away_message); if (server->cmd_list_regexp) { diff --git a/src/plugins/plugin-script-api.c b/src/plugins/plugin-script-api.c index 9c652ee95..3f1450eac 100644 --- a/src/plugins/plugin-script-api.c +++ b/src/plugins/plugin-script-api.c @@ -72,8 +72,7 @@ plugin_script_api_string_match_list (struct t_weechat_plugin *weechat_plugin, (const char **)list_masks, case_sensitive); - if (list_masks) - weechat_string_free_split (list_masks); + weechat_string_free_split (list_masks); return match; } diff --git a/src/plugins/relay/relay-auth.c b/src/plugins/relay/relay-auth.c index f1d4e0b59..5579b18fb 100644 --- a/src/plugins/relay/relay-auth.c +++ b/src/plugins/relay/relay-auth.c @@ -166,8 +166,7 @@ relay_auth_parse_sha (const char *parameters, if (!argv || (argc < 2)) { /* not enough parameters */ - if (argv) - weechat_string_free_split (argv); + weechat_string_free_split (argv); return; } @@ -240,8 +239,7 @@ relay_auth_parse_pbkdf2 (const char *parameters, if (!argv || (argc < 3)) { /* not enough parameters */ - if (argv) - weechat_string_free_split (argv); + weechat_string_free_split (argv); return; } diff --git a/src/plugins/relay/relay-http.c b/src/plugins/relay/relay-http.c index 0d90ff4bc..6da952cf2 100644 --- a/src/plugins/relay/relay-http.c +++ b/src/plugins/relay/relay-http.c @@ -321,8 +321,7 @@ relay_http_parse_path (const char *path, free (str_path); free (str_params); - if (items_path) - weechat_string_free_split (items_path); + weechat_string_free_split (items_path); } /* @@ -378,8 +377,7 @@ relay_http_parse_method_path (struct t_relay_http_request *request, return 1; error: - if (items) - weechat_string_free_split (items); + weechat_string_free_split (items); request->status = RELAY_HTTP_END; return 0; } @@ -1335,8 +1333,7 @@ relay_http_request_free (struct t_relay_http_request *request) weechat_string_dyn_free (request->raw, 1); free (request->method); free (request->path); - if (request->path_items) - weechat_string_free_split (request->path_items); + weechat_string_free_split (request->path_items); weechat_hashtable_free (request->params); free (request->http_version); weechat_hashtable_free (request->headers); diff --git a/src/plugins/relay/relay-info.c b/src/plugins/relay/relay-info.c index 18322ffbf..b068f0b9e 100644 --- a/src/plugins/relay/relay-info.c +++ b/src/plugins/relay/relay-info.c @@ -106,8 +106,7 @@ relay_info_info_relay_client_count_cb (const void *pointer, void *data, ptr_count = str_count; end: - if (items) - weechat_string_free_split (items); + weechat_string_free_split (items); return (ptr_count) ? strdup (ptr_count) : NULL; } diff --git a/src/plugins/relay/relay-websocket.c b/src/plugins/relay/relay-websocket.c index bd9aceb1c..7da984adb 100644 --- a/src/plugins/relay/relay-websocket.c +++ b/src/plugins/relay/relay-websocket.c @@ -361,12 +361,10 @@ relay_websocket_parse_extensions (const char *extensions, ws_deflate->window_bits_inflate = (int)number; } } - if (items) - weechat_string_free_split (items); + weechat_string_free_split (items); } } - if (params) - weechat_string_free_split (params); + weechat_string_free_split (params); } weechat_string_free_split (exts); diff --git a/src/plugins/relay/weechat/relay-weechat-msg.c b/src/plugins/relay/weechat/relay-weechat-msg.c index 7514e3f5a..9f2dfa23e 100644 --- a/src/plugins/relay/weechat/relay-weechat-msg.c +++ b/src/plugins/relay/weechat/relay-weechat-msg.c @@ -768,11 +768,9 @@ relay_weechat_msg_add_hdata (struct t_relay_weechat_msg *msg, rc = 1; end: - if (list_keys) - weechat_string_free_split (list_keys); + weechat_string_free_split (list_keys); free (keys_types); - if (list_path) - weechat_string_free_split (list_path); + weechat_string_free_split (list_path); free (path_returned); free (hdata_head); diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c index 1d5d772e6..d2b3e144c 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.c +++ b/src/plugins/relay/weechat/relay-weechat-protocol.c @@ -1839,8 +1839,6 @@ end: free (data_unescaped); free (id); free (command); - if (argv) - weechat_string_free_split (argv); - if (argv_eol) - weechat_string_free_split (argv_eol); + weechat_string_free_split (argv); + weechat_string_free_split (argv_eol); } diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c index e270a488f..86db3acd8 100644 --- a/src/plugins/script/script-action.c +++ b/src/plugins/script/script-action.c @@ -1567,10 +1567,8 @@ script_action_run_all () } } } - if (argv) - weechat_string_free_split (argv); - if (argv_eol) - weechat_string_free_split (argv_eol); + weechat_string_free_split (argv); + weechat_string_free_split (argv_eol); } weechat_string_free_split (actions); } diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index e1405e47f..701f30ce6 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -966,10 +966,8 @@ script_repo_match_filter (struct t_script_repo *script) } } - if (words) - weechat_string_free_split (words); - if (tags) - weechat_string_free_split (tags); + weechat_string_free_split (words); + weechat_string_free_split (tags); return 1; } diff --git a/src/plugins/spell/spell-speller.c b/src/plugins/spell/spell-speller.c index 5ae383126..b00d8208d 100644 --- a/src/plugins/spell/spell-speller.c +++ b/src/plugins/spell/spell-speller.c @@ -416,8 +416,7 @@ spell_speller_buffer_new (struct t_gui_buffer *buffer) new_speller_buffer->spellers[num_dicts] = NULL; } } - if (dicts) - weechat_string_free_split (dicts); + weechat_string_free_split (dicts); } weechat_hashtable_set (spell_speller_buffer, diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c index ea67af15f..46daf56e6 100644 --- a/src/plugins/trigger/trigger-callback.c +++ b/src/plugins/trigger/trigger-callback.c @@ -981,8 +981,7 @@ end: string_modified = (ptr_string && (strcmp (ptr_string, string) != 0)) ? strdup (ptr_string) : NULL; - if (tags) - weechat_string_free_split (tags); + weechat_string_free_split (tags); free (string_no_color); TRIGGER_CALLBACK_CB_END(string_modified); @@ -1120,8 +1119,7 @@ trigger_callback_line_cb (const void *pointer, void *data, } end: - if (tags) - weechat_string_free_split (tags); + weechat_string_free_split (tags); TRIGGER_CALLBACK_CB_END(hashtable); } diff --git a/src/plugins/trigger/trigger-command.c b/src/plugins/trigger/trigger-command.c index 7a160180d..8491ea1fc 100644 --- a/src/plugins/trigger/trigger-command.c +++ b/src/plugins/trigger/trigger-command.c @@ -436,8 +436,7 @@ trigger_command_list_default (int verbose) } trigger_regex_free (®ex_count, ®ex); - if (commands) - weechat_string_free_split (commands); + weechat_string_free_split (commands); } /* @@ -838,8 +837,7 @@ trigger_command_trigger (const void *pointer, void *data, weechat_buffer_set (buffer, "input_pos", "13"); free (input); } - if (items) - weechat_string_free_split (items); + weechat_string_free_split (items); goto end; } @@ -1242,8 +1240,7 @@ error: rc = WEECHAT_RC_ERROR; end: - if (sargv) - weechat_string_free_split (sargv); + weechat_string_free_split (sargv); if (rc == WEECHAT_RC_ERROR) WEECHAT_COMMAND_ERROR; diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c index 2c72a0c0c..6c9327afe 100644 --- a/src/plugins/trigger/trigger.c +++ b/src/plugins/trigger/trigger.c @@ -598,10 +598,8 @@ trigger_hook (struct t_trigger *trigger) trigger->name); } - if (argv) - weechat_string_free_split (argv); - if (argv_eol) - weechat_string_free_split (argv_eol); + weechat_string_free_split (argv); + weechat_string_free_split (argv_eol); } /* @@ -1235,8 +1233,7 @@ trigger_free (struct t_trigger *trigger) if (trigger->options[i]) weechat_config_option_free (trigger->options[i]); } - if (trigger->commands) - weechat_string_free_split (trigger->commands); + weechat_string_free_split (trigger->commands); free (trigger); diff --git a/src/plugins/typing/typing.c b/src/plugins/typing/typing.c index c1cb1990c..dc0c51080 100644 --- a/src/plugins/typing/typing.c +++ b/src/plugins/typing/typing.c @@ -440,8 +440,7 @@ typing_typing_set_nick_signal_cb (const void *pointer, void *data, weechat_bar_item_update (TYPING_BAR_ITEM_NAME); end: - if (items) - weechat_string_free_split (items); + weechat_string_free_split (items); return WEECHAT_RC_OK; } |