mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
fix the possibility to load a perl script even if it doesn't call register() function
This commit is contained in:
@@ -2179,13 +2179,11 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
|
||||
|
||||
curModule = rb_define_module(modname);
|
||||
|
||||
ruby_current_script_filename = strdup (filename);
|
||||
ruby_current_script_filename = filename;
|
||||
|
||||
ruby_retcode = rb_protect_funcall (curModule, rb_intern("load_eval_file"),
|
||||
&ruby_error, 1, rb_str_new2(filename));
|
||||
|
||||
free (ruby_current_script_filename);
|
||||
|
||||
if (ruby_retcode == Qnil) {
|
||||
err = rb_inspect(rb_gv_get("$!"));
|
||||
ruby_plugin->print_server (ruby_plugin, "Ruby error: \"%s\"", STR2CSTR(err));
|
||||
|
||||
Reference in New Issue
Block a user