aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 928c312bea..bd1a13cfaf 100644
--- a/gc.c
+++ b/gc.c
@@ -1837,9 +1837,12 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
VALUE of;
rb_secure(4);
- if (rb_scan_args(argc, argv, "01", &of) == 0) {
+ if (argc == 0) {
of = 0;
}
+ else {
+ rb_scan_args(argc, argv, "01", &of);
+ }
RETURN_ENUMERATOR(os, 1, &of);
return os_obj_of(of);
}