diff options
author | Emmanuel Bouthenot <kolter@openics.org> | 2007-02-17 18:23:50 +0000 |
---|---|---|
committer | Emmanuel Bouthenot <kolter@openics.org> | 2007-02-17 18:23:50 +0000 |
commit | 429167f032219d2b687ef8b877ceeaf62e30366c (patch) | |
tree | 6b596c49a780c34f2e7e07dd70ac5883cd3fd8a8 /src/plugins/scripts/ruby/weechat-ruby.c | |
parent | aba6e1257d4ef85e8641ee0f35428ea53a217b03 (diff) | |
download | weechat-429167f032219d2b687ef8b877ceeaf62e30366c.zip |
fix the possibility to load a perl script even if it doesn't call register() function
Diffstat (limited to 'src/plugins/scripts/ruby/weechat-ruby.c')
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby.c | 4 |
1 files changed, 1 insertions, 3 deletions
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)); |