From f77f9da445cf033a165878366e767b49458bd3c2 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 22 Dec 2008 02:12:37 +0000 Subject: [PATCH] * string.c (rb_str_upto): should return enumerator if called without block. [ruby-dev:37526] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 55238ee24b..f23954b819 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Dec 22 10:59:31 2008 Yukihiro Matsumoto + + * string.c (rb_str_upto): should return enumerator if called + without block. [ruby-dev:37526] + Mon Dec 22 09:54:43 2008 Yukihiro Matsumoto * parse.y (gettable_gen): the encoding of __FILE__ should be diff --git a/string.c b/string.c index d34a1e861c..9db82d4a21 100644 --- a/string.c +++ b/string.c @@ -2861,6 +2861,7 @@ rb_str_upto(int argc, VALUE *argv, VALUE beg) rb_encoding *enc; rb_scan_args(argc, argv, "11", &end, &exclusive); + RETURN_ENUMERATOR(beg, argc, argv); excl = RTEST(exclusive); CONST_ID(succ, "succ"); StringValue(end);