aboutsummaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-19 10:45:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-19 10:45:16 +0000
commit4cfc6cedc46c3bf95497290092a63028d6b4e3b2 (patch)
treed000bbb6243abb61c3086de140a1ca6173381bd2 /template
parentf1a33775494f1b81d6f6722817f1c7e5db61a27c (diff)
downloadruby-4cfc6cedc46c3bf95497290092a63028d6b4e3b2.tar.gz
template/prelude.c.tmpl: allow UTF-8 characters
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r--template/prelude.c.tmpl3
1 files changed, 2 insertions, 1 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index aa760dc054..99dc25fee8 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -45,6 +45,7 @@ class Prelude
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)
% 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)