diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 11:09:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 11:09:41 +0000 |
commit | d0d32ba1e8e30443cadc0580e3f1e534af547f07 (patch) | |
tree | 4fdbc573d80973a1a9d63e97d1be1a8a004781f4 | |
parent | 49b25aaa229f32aef88c56bf8ee422836f9a7f37 (diff) | |
download | ruby-d0d32ba1e8e30443cadc0580e3f1e534af547f07.tar.gz |
ruby.c: fix r60393
* ruby.c (load_file_internal): set loop options after parsing
shebang line.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ruby.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1648,7 +1648,6 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) 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, ruby_cmdline_options_t *opt) 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) 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); |