summaryrefslogtreecommitdiff
path: root/ext/sdbm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sdbm/init.c')
-rw-r--r--ext/sdbm/init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 3810b21bed9..239e7f29756 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -486,6 +486,8 @@ fsdbm_each_value(VALUE obj)
struct dbmdata *dbmp;
DBM *dbm;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);
@@ -502,6 +504,8 @@ fsdbm_each_key(VALUE obj)
struct dbmdata *dbmp;
DBM *dbm;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
rb_yield(rb_tainted_str_new(key.dptr, key.dsize));
@@ -518,6 +522,8 @@ fsdbm_each_pair(VALUE obj)
struct dbmdata *dbmp;
VALUE keystr, valstr;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
val = sdbm_fetch(dbm, key);