ruby-changes:48281
From: nobu <ko1@a...>
Date: Tue, 24 Oct 2017 20:09:46 +0900 (JST)
Subject: [ruby-changes:48281] nobu:r60396 (trunk): ruby.c: fix r60393
nobu 2017-10-24 20:09:41 +0900 (Tue, 24 Oct 2017) New Revision: 60396 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60396 Log: ruby.c: fix r60393 * ruby.c (load_file_internal): set loop options after parsing shebang line. Modified files: trunk/ruby.c Index: ruby.c =================================================================== --- ruby.c (revision 60395) +++ ruby.c (revision 60396) @@ -1648,7 +1648,6 @@ process_options(int argc, char **argv, r https://github.com/ruby/ruby/blob/trunk/ruby.c#L1648 base_block = toplevel_context(toplevel_binding); rb_parser_set_context(parser, base_block, TRUE); - rb_parser_set_options(parser, opt->do_print, opt->do_loop, opt->do_line, opt->do_split); if (opt->e_script) { VALUE progname = rb_progname; @@ -1673,6 +1672,8 @@ process_options(int argc, char **argv, r https://github.com/ruby/ruby/blob/trunk/ruby.c#L1672 require_libraries(&opt->req_list); } ruby_set_script_name(progname); + rb_parser_set_options(parser, opt->do_print, opt->do_loop, + opt->do_line, opt->do_split); tree = rb_parser_compile_string(parser, opt->script, opt->e_script, 1); } else { @@ -1885,6 +1886,8 @@ load_file_internal(VALUE argp_v) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1886 else { enc = rb_utf8_encoding(); } + rb_parser_set_options(parser, opt->do_print, opt->do_loop, + opt->do_line, opt->do_split); if (NIL_P(f)) { f = rb_str_new(0, 0); rb_enc_associate(f, enc); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/