From 65dc7d004e6a458155a5f1ddd42439695e1ef10c Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 22 Jul 2013 15:13:18 +0000 Subject: merge revision(s) 42103: [Backport #8662] * vm_eval.c (eval_string_with_cref): use the given file name unless eval even if scope is given. additional fix for [Bug #8436]. based on the patch by srawlins at [ruby-core:56099] [Bug #8662]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vm_eval.c') diff --git a/vm_eval.c b/vm_eval.c index ea1bc651e1..10dadaf41e 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1198,7 +1198,10 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char if (rb_obj_is_kind_of(scope, rb_cBinding)) { GetBindingPtr(scope, bind); envval = bind->env; - if (strcmp(file, "(eval)") == 0 && bind->path != Qnil) { + if (strcmp(file, "(eval)") != 0) { + absolute_path = rb_str_new_cstr(file); + } + else if (bind->path != Qnil) { file = RSTRING_PTR(bind->path); line = bind->first_lineno; absolute_path = rb_current_realfilepath(); -- cgit v1.2.3