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

merges r23491 from trunk into ruby_1_9_1.

--
* vm_method.c (rb_attr): should preserve encoding info.
  [ruby-dev:38498]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@23536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2009-05-22 09:49:35 +00:00
parent 68a2b3cf7f
commit a922df795b
3 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Wed May 20 00:05:52 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* vm_method.c (rb_attr): should preserve encoding info.
[ruby-dev:38498]
Sun May 17 14:23:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* compile.c (rb_parse_in_eval): returns true in true eval, not in

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "1.9.1"
#define RUBY_RELEASE_DATE "2009-05-12"
#define RUBY_PATCHLEVEL 150
#define RUBY_PATCHLEVEL 151
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1

View file

@ -432,6 +432,7 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex)
{
const char *name;
ID attriv;
VALUE aname;
int noex;
if (!ex) {
@ -459,7 +460,9 @@ rb_attr(VALUE klass, ID id, int read, int write, int ex)
if (!name) {
rb_raise(rb_eArgError, "argument needs to be symbol or string");
}
attriv = rb_intern_str(rb_sprintf("@%s", name));
aname = rb_sprintf("@%s", name);
rb_enc_copy(aname, rb_id2str(id));
attriv = rb_intern_str(aname);
if (read) {
rb_add_method(klass, id, NEW_IVAR(attriv), noex);
}