summaryrefslogtreecommitdiff
path: root/ext/gdbm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gdbm')
-rw-r--r--ext/gdbm/gdbm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 8a1acbc96fc..04fdf886b5b 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -801,6 +801,8 @@ fgdbm_each_value(VALUE obj)
GDBM_FILE dbm;
VALUE keystr;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
@@ -825,6 +827,8 @@ fgdbm_each_key(VALUE obj)
GDBM_FILE dbm;
VALUE keystr;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
@@ -849,6 +853,8 @@ fgdbm_each_pair(VALUE obj)
struct dbmdata *dbmp;
VALUE keystr;
+ RETURN_ENUMERATOR(obj, 0, 0);
+
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {