From afd765f2ee1d7f0a34ad747d6103926ca100b120 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 23 Nov 2020 09:16:16 +0900 Subject: Initialize UTF-8 encoding first as it is used always now --- ruby.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 4feae7757a..2ddea6b430 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); -- cgit v1.2.3