summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-24 11:09:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-24 11:09:41 +0000
commitd0d32ba1e8e30443cadc0580e3f1e534af547f07 (patch)
tree4fdbc573d80973a1a9d63e97d1be1a8a004781f4
parent49b25aaa229f32aef88c56bf8ee422836f9a7f37 (diff)
downloadruby-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 5cc7e252e6..94464ab2b9 100644
--- a/ruby.c
+++ b/ruby.c
@@ -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);