summaryrefslogtreecommitdiff
path: root/ext/etc/etc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/etc/etc.c')
-rw-r--r--ext/etc/etc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 049b94ec8f..ee0cd529e4 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -133,7 +133,7 @@ etc_passwd(obj)
#ifdef HAVE_GETPWENT
struct passwd *pw;
- if (rb_iterator_p()) {
+ if (rb_block_given_p()) {
setpwent();
while (pw = getpwent()) {
rb_yield(setup_passwd(pw));
@@ -210,7 +210,7 @@ etc_group(obj)
#ifdef HAVE_GETGRENT
struct group *grp;
- if (rb_iterator_p()) {
+ if (rb_block_given_p()) {
setgrent();
while (grp = getgrent()) {
rb_yield(setup_group(grp));