aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-04 07:16:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-04 07:16:04 +0000
commit0f09f59ef7ae5179936c48311574f5607034ef43 (patch)
tree8bf6b9ceb8deccd44e943a34458c142612ec4990
parent19dee8af57634c5813286ffbb63cc82611748378 (diff)
downloadruby-0f09f59ef7ae5179936c48311574f5607034ef43.tar.gz
* parse.y (reg_compile_gen): copy encoding from source string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--parse.y1
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f87ce9e81c..e41a0b108d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
-Thu Oct 4 15:57:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Oct 4 16:15:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* encoding.c (rb_obj_encoding): returns encoding of the given object.
+ * parse.y (reg_compile_gen): copy encoding from source string.
+
* re.c (Init_Regexp): new method Regexp#encoding.
* string.c (str_encoding): moved to encoding.c
diff --git a/parse.y b/parse.y
index b3c3bc98f3..b81e37ee0f 100644
--- a/parse.y
+++ b/parse.y
@@ -8170,6 +8170,7 @@ reg_compile_gen(struct parser_params* parser, VALUE str, int options)
compile_error(PARSER_ARG "%s", RSTRING_PTR(re));
return Qnil;
}
+ rb_enc_copy(re, str);
return re;
}