summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-11-23 09:16:16 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-11-23 09:45:17 +0900
commitafd765f2ee1d7f0a34ad747d6103926ca100b120 (patch)
tree435bffd1605a6247d0a0fcefb3d1f8fb12318a89 /ruby.c
parentd83aa3c2f56a082a692573270002a4574cf9b2f3 (diff)
Initialize UTF-8 encoding first as it is used always now
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ruby.c b/ruby.c
index 4feae77..2ddea6b 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1656,7 +1656,8 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
const rb_iseq_t *iseq;
rb_encoding *enc, *lenc;
#if UTF8_PATH
- rb_encoding *uenc, *ienc = 0;
+ rb_encoding *ienc = 0;
+ rb_encoding *const uenc = rb_utf8_encoding();
#endif
const char *s;
char fbuf[MAXPATHLEN];
@@ -1850,8 +1851,7 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
#endif
}
script_name = opt->script_name;
- rb_enc_associate(opt->script_name,
- IF_UTF8_PATH(uenc = rb_utf8_encoding(), lenc));
+ rb_enc_associate(opt->script_name, IF_UTF8_PATH(uenc, lenc));
#if UTF8_PATH
if (uenc != lenc) {
opt->script_name = str_conv_enc(opt->script_name, uenc, lenc);