From 429167f032219d2b687ef8b877ceeaf62e30366c Mon Sep 17 00:00:00 2001 From: Emmanuel Bouthenot Date: Sat, 17 Feb 2007 18:23:50 +0000 Subject: fix the possibility to load a perl script even if it doesn't call register() function --- src/plugins/scripts/ruby/weechat-ruby.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/plugins/scripts/ruby/weechat-ruby.c') diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c index 9ac4a237b..c685fbc46 100644 --- a/src/plugins/scripts/ruby/weechat-ruby.c +++ b/src/plugins/scripts/ruby/weechat-ruby.c @@ -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)); -- cgit v1.2.3