summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-05 00:57:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-05 00:57:02 +0000
commit2ef85089eca4a634a5619bc37084d276053f98ea (patch)
treec7c8fe5b686470c96d2e79130b788de0934b9988 /vm.c
parent45815f9c9d334e0d7a0c40ba939661efdba08153 (diff)
* ruby.c (process_options): revert r25330, so that $0 can be seen
from required libraries by -r option. [ruby-core:23717] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index 1817e6e797..04d1c815c3 100644
--- a/vm.c
+++ b/vm.c
@@ -761,8 +761,14 @@ vm_backtrace_push(void *arg, VALUE file, int line_no, VALUE name)
VALUE *aryp = arg;
VALUE bt;
- bt = rb_enc_sprintf(rb_enc_compatible(file, name), "%s:%d:in `%s'",
- RSTRING_PTR(file), line_no, RSTRING_PTR(name));
+ if (line_no) {
+ bt = rb_enc_sprintf(rb_enc_compatible(file, name), "%s:%d:in `%s'",
+ RSTRING_PTR(file), line_no, RSTRING_PTR(name));
+ }
+ else {
+ bt = rb_enc_sprintf(rb_enc_compatible(file, name), "%s:in `%s'",
+ RSTRING_PTR(file), RSTRING_PTR(name));
+ }
rb_ary_push(*aryp, bt);
return 0;
}