diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-30 07:45:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-30 07:45:42 +0000 |
commit | 1ef67e7146a4a11259900c16746d3c8db9637e52 (patch) | |
tree | f959c46536a279ad5306a5ecc8a78b7710a81b15 /variable.c | |
parent | 6410694b3783276b964e220d6db1a8c88312585a (diff) | |
download | ruby-1ef67e7146a4a11259900c16746d3c8db9637e52.tar.gz ruby-1ef67e7146a4a11259900c16746d3c8db9637e52.tar.xz ruby-1ef67e7146a4a11259900c16746d3c8db9637e52.zip |
* insns.def (defineclass): preserve encoding of class/module
names. [ruby-core:24600]
* variable.c (rb_set_class_path_string): set class path with a
string value.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/variable.c b/variable.c index f5e6ff194..1cea104bf 100644 --- a/variable.c +++ b/variable.c @@ -215,6 +215,23 @@ rb_class_path(VALUE klass) } void +rb_set_class_path_string(VALUE klass, VALUE under, VALUE name) +{ + VALUE str; + + if (under == rb_cObject) { + str = rb_str_new_frozen(name); + } + else { + str = rb_str_dup(rb_class_path(under)); + rb_str_cat2(str, "::"); + rb_str_append(str, name); + OBJ_FREEZE(str); + } + rb_ivar_set(klass, classpath, str); +} + +void rb_set_class_path(VALUE klass, VALUE under, const char *name) { VALUE str; |