mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
backtrace.c: do not print trace line if there's no backtrace history
This commit is contained in:
+3
-1
@@ -102,7 +102,9 @@ print_backtrace(mrb_state *mrb, struct RObject *exc, mrb_value backtrace)
|
||||
FILE *stream = stderr;
|
||||
|
||||
if (n != 0) {
|
||||
fprintf(stream, "trace (most recent call last):\n");
|
||||
if (n > 1) {
|
||||
fprintf(stream, "trace (most recent call last):\n");
|
||||
}
|
||||
for (i=n-1,loc=&RARRAY_PTR(backtrace)[i]; i>0; i--,loc--) {
|
||||
if (mrb_string_p(*loc)) {
|
||||
fprintf(stream, "\t[%d] %.*s\n",
|
||||
|
||||
Reference in New Issue
Block a user