From 72a3bb7edc0b5a0cad73e06f8b136f9360cccdd2 Mon Sep 17 00:00:00 2001 From: Tom Stuart Date: Sat, 1 Jul 2023 15:15:09 +0100 Subject: Allow `--backtrace-limit` option to appear in RUBYOPT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There’s no reason to prevent RUBYOPT from controlling the backtrace limit. In fact, Matz said [0] he was expecting this to be possible. [0] https://bugs.ruby-lang.org/issues/8661#note-27 --- ruby.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 28579022fe..92ea37b4f6 100644 --- a/ruby.c +++ b/ruby.c @@ -1446,7 +1446,7 @@ proc_long_options(ruby_cmdline_options_t *opt, const char *s, long argc, char ** opt->dump |= DUMP_BIT(help); return 0; } - else if (is_option_with_arg("backtrace-limit", Qfalse, Qfalse)) { + else if (is_option_with_arg("backtrace-limit", Qfalse, Qtrue)) { char *e; long n = strtol(s, &e, 10); if (errno == ERANGE || n < 0 || *e) rb_raise(rb_eRuntimeError, "wrong limit for backtrace length"); -- cgit v1.2.3