1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (rb_reg_source): set encoding as regexp encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-01-27 07:26:51 +00:00
parent 3f68c10536
commit f3fe101d55
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Sun Jan 27 16:25:27 2008 NARUSE, Yui <naruse@ruby-lang.org>
* re.c (rb_reg_source): set encoding as regexp encoding.
Sun Jan 27 05:56:39 2008 Tanaka Akira <akr@fsij.org>
* re.c (rb_reg_preprocess): force fixed encoding when ASCII

2
re.c
View file

@ -311,7 +311,7 @@ rb_reg_source(VALUE re)
VALUE str;
rb_reg_check(re);
str = rb_str_new(RREGEXP(re)->str,RREGEXP(re)->len);
str = rb_enc_str_new(RREGEXP(re)->str,RREGEXP(re)->len, rb_enc_get(re));
if (OBJ_TAINTED(re)) OBJ_TAINT(str);
return str;
}