ruby-changes:55409
From: nobu <ko1@a...>
Date: Fri, 19 Apr 2019 19:45:20 +0900 (JST)
Subject: [ruby-changes:55409] nobu:r67617 (trunk): template/prelude.c.tmpl: allow UTF-8 characters
nobu 2019-04-19 19:45:16 +0900 (Fri, 19 Apr 2019) New Revision: 67617 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67617 Log: template/prelude.c.tmpl: allow UTF-8 characters Modified files: trunk/template/prelude.c.tmpl Index: template/prelude.c.tmpl =================================================================== --- template/prelude.c.tmpl (revision 67616) +++ template/prelude.c.tmpl (revision 67617) @@ -45,6 +45,7 @@ class Prelude https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L45 lines = [] result = [@preludes.size, @vpath.strip(filename), lines, sub] @vpath.foreach(filename) do |line| + line.force_encoding("ASCII-8BIT") if line.respond_to?(:force_encoding) @preludes[filename] ||= result comment = ($1 || '' if line.sub!(/(?:^|\s+)\#(?:$|[#\s](.*))/, '')) if line.size > LINE_LIMIT @@ -137,7 +138,7 @@ prelude_prefix_path(VALUE self) https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L138 % unless preludes.empty? #define PRELUDE_NAME(n) rb_usascii_str_new_static(prelude_name##n, sizeof(prelude_name##n)-1) -#define PRELUDE_CODE(n) rb_usascii_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n)) +#define PRELUDE_CODE(n) rb_utf8_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n)) COMPILER_WARNING_PUSH #if GCC_VERSION_SINCE(4, 2, 0) COMPILER_WARNING_ERROR(-Wmissing-field-initializers) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/