From 5067bfe36ee11c7cf601df7e2bab3ed5f3b01e4e Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 6 Feb 2009 03:05:27 +0000 Subject: [PATCH] * ruby.c (process_options): -K and -E in shebang should be reflect to default_external. [ruby-dev:37920] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ruby.c | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a457296930..e53c2b4724 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 6 12:03:47 2009 NAKAMURA Usaku + + * ruby.c (process_options): -K and -E in shebang should be reflect to + default_external. [ruby-dev:37920] + Fri Feb 6 07:52:57 2009 Tanaka Akira * ext/pty/pty.c (chfunc): type fixed. diff --git a/ruby.c b/ruby.c index 99852afdbd..16cf652b5e 100644 --- a/ruby.c +++ b/ruby.c @@ -1296,13 +1296,6 @@ process_options(VALUE arg) opt->src.enc.index = opt_enc_index(opt->src.enc.name); src_encoding_index = opt->src.enc.index; } - if (opt->ext.enc.index >= 0) { - enc = rb_enc_from_index(opt->ext.enc.index); - } - else { - enc = lenc; - } - rb_enc_set_default_external(rb_enc_from_encoding(enc)); if (opt->intern.enc.index >= 0) { enc = rb_enc_from_index(opt->intern.enc.index); rb_enc_set_default_internal(rb_enc_from_encoding(enc)); @@ -1363,6 +1356,13 @@ process_options(VALUE arg) } if (opt->dump & DUMP_BIT(yydebug)) return Qtrue; + if (opt->ext.enc.index >= 0) { + enc = rb_enc_from_index(opt->ext.enc.index); + } + else { + enc = lenc; + } + rb_enc_set_default_external(rb_enc_from_encoding(enc)); if (opt->intern.enc.index >= 0) { /* Set in the shebang line */ enc = rb_enc_from_index(opt->intern.enc.index);