mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 13:26:38 +02:00
scripts: reset current script pointer when load of script fails in python/perl/ruby/lua/tcl plugins
This commit is contained in:
@@ -61,6 +61,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
* ruby: fix value returned in case of error in functions:
|
||||
config_option_reset, config_color, config_color_default, config_write,
|
||||
config_read, config_reload, buffer_string_replace_local_var, command
|
||||
* scripts: reset current script pointer when load of script fails in
|
||||
python/perl/ruby/lua/tcl plugins
|
||||
* scripts: fix return code of function bar_set in
|
||||
python/perl/ruby/lua/tcl/guile plugins
|
||||
* scripts: fix type of value returned by function hdata_time (from string to
|
||||
|
||||
@@ -425,8 +425,10 @@ weechat_lua_load (const char *filename)
|
||||
/* if script was registered, remove it from list */
|
||||
if (lua_current_script)
|
||||
{
|
||||
plugin_script_remove (weechat_lua_plugin, &lua_scripts, &last_lua_script,
|
||||
plugin_script_remove (weechat_lua_plugin,
|
||||
&lua_scripts, &last_lua_script,
|
||||
lua_current_script);
|
||||
lua_current_script = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -438,6 +438,7 @@ weechat_perl_load (const char *filename)
|
||||
plugin_script_remove (weechat_perl_plugin,
|
||||
&perl_scripts, &last_perl_script,
|
||||
perl_current_script);
|
||||
perl_current_script = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -722,11 +722,12 @@ weechat_python_load (const char *filename)
|
||||
PyErr_Print ();
|
||||
|
||||
/* if script was registered, remove it from list */
|
||||
if (python_current_script != NULL)
|
||||
if (python_current_script)
|
||||
{
|
||||
plugin_script_remove (weechat_python_plugin,
|
||||
&python_scripts, &last_python_script,
|
||||
python_current_script);
|
||||
python_current_script = NULL;
|
||||
}
|
||||
|
||||
Py_EndInterpreter (python_current_interpreter);
|
||||
|
||||
@@ -595,11 +595,12 @@ weechat_ruby_load (const char *filename)
|
||||
err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
|
||||
if (ruby_current_script != NULL)
|
||||
if (ruby_current_script)
|
||||
{
|
||||
plugin_script_remove (weechat_ruby_plugin,
|
||||
&ruby_scripts, &last_ruby_script,
|
||||
ruby_current_script);
|
||||
ruby_current_script = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -339,8 +339,17 @@ weechat_tcl_load (const char *filename)
|
||||
"parsing file \"%s\": %s"),
|
||||
weechat_prefix ("error"), TCL_PLUGIN_NAME, filename,
|
||||
Tcl_GetStringFromObj (Tcl_GetObjResult (interp), &i));
|
||||
/* this OK, maybe "register" was called, so not return */
|
||||
/* return 0; */
|
||||
|
||||
/* if script was registered, remove it from list */
|
||||
if (tcl_current_script)
|
||||
{
|
||||
plugin_script_remove (weechat_tcl_plugin,
|
||||
&tcl_scripts, &last_tcl_script,
|
||||
tcl_current_script);
|
||||
tcl_current_script = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!tcl_registered_script)
|
||||
|
||||
Reference in New Issue
Block a user