summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-28 07:22:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-28 07:22:43 +0000
commit4079a35447218918a2494b5d7242c9a80b540183 (patch)
treea5b9f053fb5b66c3316cfe3615896660db6adf67 /ruby.c
parentc98b8d622b0d008dc881f92b1f71aebac009fcf2 (diff)
ruby.c: no -r when dump
* ruby.c (process_options, load_file_internal2): should not require other files when dump option is given. [ruby-dev:48712] [Bug #10435] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ruby.c b/ruby.c
index d0130ec..e5c4f8f 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1415,8 +1415,10 @@ process_options(int argc, char **argv, struct cmdline_options *opt)
eenc = lenc;
}
rb_enc_associate(opt->e_script, eenc);
- ruby_set_script_name(opt->script_name);
- require_libraries(&opt->req_list);
+ if (!(opt->dump & ~DUMP_BIT(version_v))) {
+ ruby_set_script_name(opt->script_name);
+ require_libraries(&opt->req_list);
+ }
ruby_set_script_name(progname);
PREPARE_PARSE_MAIN({
@@ -1612,8 +1614,10 @@ load_file_internal2(VALUE argp_v)
if (f != rb_stdin) rb_io_close(f);
f = Qnil;
}
- ruby_set_script_name(opt->script_name);
- require_libraries(&opt->req_list); /* Why here? unnatural */
+ if (!(opt->dump & ~DUMP_BIT(version_v))) {
+ ruby_set_script_name(opt->script_name);
+ require_libraries(&opt->req_list); /* Why here? unnatural */
+ }
}
if (opt->src.enc.index >= 0) {
enc = rb_enc_from_index(opt->src.enc.index);