summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-02-01 19:19:11 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-02-01 19:19:27 +0900
commit9aa7b57ba4453fce871011c1d9587536d425700f (patch)
tree5b7e5c12b03ee451482fc027d977ea52d926d788 /ruby.c
parent147453ad1e85bc94506c269e363e736675946908 (diff)
merge revision(s) 6f6dfdcc685077f0f85dcdd63843ecfc0f6fbfb6: [Backport #17523]
Make warning values consistent [Bug #17523] They should be affected, as well as `$VERBOSE`, by `-w`/`-W` options, not only in the main script but in scripts loaded by `-r` option too. --- ruby.c | 4 ++-- test/ruby/test_rubyoptions.rb | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-)
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ruby.c b/ruby.c
index fa65c16bd4..1af326c8e1 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1510,6 +1510,8 @@ ruby_opt_init(ruby_cmdline_options_t *opt)
}
}
+ rb_warning_category_update(opt->warn.mask, opt->warn.set);
+
Init_ext(); /* load statically linked extensions before rubygems */
rb_call_builtin_inits();
ruby_init_prelude();
@@ -1946,7 +1948,6 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
ruby_set_script_name(progname);
rb_parser_set_options(parser, opt->do_print, opt->do_loop,
opt->do_line, opt->do_split);
- rb_warning_category_update(opt->warn.mask, opt->warn.set);
ast = rb_parser_compile_string(parser, opt->script, opt->e_script, 1);
}
else {
@@ -2186,7 +2187,6 @@ load_file_internal(VALUE argp_v)
}
rb_parser_set_options(parser, opt->do_print, opt->do_loop,
opt->do_line, opt->do_split);
- rb_warning_category_update(opt->warn.mask, opt->warn.set);
if (NIL_P(f)) {
f = rb_str_new(0, 0);
rb_enc_associate(f, enc);