From 6ff75042db1a68a23a133667b3a97c9ec23c131e Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 16 Mar 2010 17:40:00 +0000 Subject: * compile.c, iseq.c, ruby.c, vm.c, vm_core.h, vm_eval.c: add absolute path field into rb_iseq_t. The field contains a string representing a path to corresponding source file. or nil when the iseq is created from -e, stdin, eval, etc. This field is used for require_relative. [ruby-dev:40004] * load.c (rb_f_require_relative): add C implementation of require_relative. * prelude.rb (require_relative): get rid of Ruby implementation of require_relative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index bf0f83d67c..b97830f691 100644 --- a/ruby.c +++ b/ruby.c @@ -1454,7 +1454,9 @@ process_options(int argc, char **argv, struct cmdline_options *opt) } PREPARE_PARSE_MAIN({ - iseq = rb_iseq_new_main(tree, opt->script_name); + VALUE path = Qnil; + if (!opt->e_script && strcmp(opt->script, "-")) path = opt->script_name; + iseq = rb_iseq_new_main(tree, opt->script_name, path); }); if (opt->dump & DUMP_BIT(insns)) { -- cgit v1.2.3