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

* string.c (rb_str_new2): NULL pointer check added.

* class.c (rb_define_module_under): should locate predefined
  module using rb_const_defined_at().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2002-01-07 05:27:01 +00:00
parent 6a100f3ce4
commit c9f4686694
5 changed files with 20 additions and 21 deletions

View file

@ -266,8 +266,8 @@ rb_define_module_under(outer, name)
ID id;
id = rb_intern(name);
if (rb_const_defined(outer, id)) {
module = rb_const_get(rb_cObject, id);
if (rb_const_defined_at(outer, id)) {
module = rb_const_get(outer, id);
if (TYPE(module) == T_MODULE)
return module;
rb_raise(rb_eTypeError, "%s::%s is not a module",