summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
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 588d668..7a85801 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);
}