mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
eval_error.c: fix off-by-one error for --backtrace-limit
https://bugs.ruby-lang.org/issues/17413
This commit is contained in:
parent
ac78d90d5e
commit
eee93bc933
1 changed files with 2 additions and 2 deletions
|
@ -253,9 +253,9 @@ print_backtrace(const VALUE eclass, const VALUE errat, const VALUE str, int reve
|
|||
}
|
||||
|
||||
// skip for explicit limit
|
||||
if (rb_backtrace_length_limit >= 0 && len > rb_backtrace_length_limit + 1) {
|
||||
if (rb_backtrace_length_limit >= 0 && len > rb_backtrace_length_limit + 2) {
|
||||
skip_start = rb_backtrace_length_limit + 1;
|
||||
skip_len = len - rb_backtrace_length_limit;
|
||||
skip_len = len - skip_start;
|
||||
}
|
||||
|
||||
for (i = 1; i < len; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue