Skip to content

Commit

Permalink
String#upto returns an Enumerator object if a block is not passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Apr 6, 2012
1 parent 33add5d commit d1f85a9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions string.c
Expand Up @@ -5150,6 +5150,7 @@ rstr_upto(VALUE str, SEL sel, int argc, VALUE *argv)
VALUE beg = str;
VALUE end, exclusive;
rb_scan_args(argc, argv, "11", &end, &exclusive);
RETURN_ENUMERATOR(beg, argc, argv);

bool excl = RTEST(exclusive);
StringValue(end);
Expand Down

0 comments on commit d1f85a9

Please sign in to comment.