mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 12:26:40 +02:00
script: only check if return value of plugin_script_search_path is NULL (issue #2019)
This commit is contained in:
@@ -1152,16 +1152,8 @@ plugin_script_remove_file (struct t_weechat_plugin *weechat_plugin,
|
||||
while (i < 2)
|
||||
{
|
||||
path_script = plugin_script_search_path (weechat_plugin, name, 0);
|
||||
/*
|
||||
* script not found? (if path_script == name, that means the function
|
||||
* above did not find the script)
|
||||
*/
|
||||
if (!path_script || (strcmp (path_script, name) == 0))
|
||||
{
|
||||
if (path_script)
|
||||
free (path_script);
|
||||
if (!path_script)
|
||||
break;
|
||||
}
|
||||
num_found++;
|
||||
if (unlink (path_script) == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user