summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-05 03:25:55 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-05 03:25:55 +0000
commit6c77ae07a5f90f625346ac4193ad8c63c62ba5a1 (patch)
tree6f5b4e0361c725ee439c0074553ef3c068a5ad78 /enumerator.c
parentb4a117f8d3be2aff93521c388587eff8c8601199 (diff)
* enumerator.c (enumerator_with_index): Restore handling of a nil memo
from r39594. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c
index bd039d2..7143e37 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -492,6 +492,8 @@ enumerator_with_index(int argc, VALUE *argv, VALUE obj)
rb_scan_args(argc, argv, "01", &memo);
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_size);
+ if (NIL_P(memo))
+ memo = INT2NUM(0);
return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)&memo);
}