summaryrefslogtreecommitdiff
path: root/ext/digest
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 13:41:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 13:41:54 +0000
commit52f5f410e4ce1614793328d38d55f84f66371e6e (patch)
tree3b010757fccaa8b5f9a40754b9d586c953f1d506 /ext/digest
parent2082417a48d56295796e2bbfc2001ecf5008a88a (diff)
* internal.h: add for internal use only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest')
-rw-r--r--ext/digest/digest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index 6f9149c..d535b35 100644
--- a/ext/digest/digest.c
+++ b/ext/digest/digest.c
@@ -436,14 +436,14 @@ get_digest_base_metadata(VALUE klass)
VALUE obj;
rb_digest_metadata_t *algo;
- for (p = klass; p; p = RCLASS_SUPER(p)) {
+ for (p = klass; !NIL_P(p); p = rb_class_superclass(p)) {
if (rb_ivar_defined(p, id_metadata)) {
obj = rb_ivar_get(p, id_metadata);
break;
}
}
- if (!p)
+ if (NIL_P(p))
rb_raise(rb_eRuntimeError, "Digest::Base cannot be directly inherited in Ruby");
Data_Get_Struct(obj, rb_digest_metadata_t, algo);