summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-16 10:33:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-16 10:33:06 +0000
commit40a3f601e43a137e56b2c28454ffb6ce79d7ec7e (patch)
treecf4e94cab7bee1f0e15d9ab8d1885fb0739fb408 /eval.c
parent3196645aee3add70a33f3d926d1d6e3820d39377 (diff)
ruby -v
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 588d668038..7a858018c0 100644
--- a/eval.c
+++ b/eval.c
@@ -793,6 +793,9 @@ error_pos()
fprintf(stderr, "%s:%d:in `%s'", ruby_sourcefile, ruby_sourceline,
rb_id2name(ruby_frame->last_func));
}
+ else if (ruby_sourceline == 0) {
+ fprintf(stderr, "%s", ruby_sourcefile);
+ }
else {
fprintf(stderr, "%s:%d", ruby_sourcefile, ruby_sourceline);
}
@@ -4149,6 +4152,9 @@ backtrace(lev)
ruby_sourcefile, ruby_sourceline,
rb_id2name(frame->last_func));
}
+ else if (ruby_sourceline == 0) {
+ snprintf(buf, BUFSIZ, "%s", ruby_sourcefile);
+ }
else {
snprintf(buf, BUFSIZ, "%s:%d", ruby_sourcefile, ruby_sourceline);
}