ruby-changes:63695
From: Nobuyoshi <ko1@a...>
Date: Mon, 23 Nov 2020 09:45:57 +0900 (JST)
Subject: [ruby-changes:63695] afd765f2ee (master): Initialize UTF-8 encoding first as it is used always now
https://git.ruby-lang.org/ruby.git/commit/?id=afd765f2ee From afd765f2ee1d7f0a34ad747d6103926ca100b120 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 23 Nov 2020 09:16:16 +0900 Subject: Initialize UTF-8 encoding first as it is used always now 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) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1656 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) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1851 #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 v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/