mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
19991104
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
78211f7a4c
commit
c75b5b2fac
6 changed files with 29 additions and 6 deletions
3
string.c
3
string.c
|
|
@ -756,6 +756,7 @@ rb_str_upto(beg, end, excl)
|
|||
int excl;
|
||||
{
|
||||
VALUE current;
|
||||
ID succ = rb_intern("succ");
|
||||
|
||||
if (TYPE(end) != T_STRING) end = rb_str_to_str(end);
|
||||
|
||||
|
|
@ -763,7 +764,7 @@ rb_str_upto(beg, end, excl)
|
|||
while (rb_str_cmp(current, end) <= 0) {
|
||||
rb_yield(current);
|
||||
if (!excl && rb_str_equal(current, end)) break;
|
||||
current = rb_str_succ(current);
|
||||
current = rb_funcall(current, succ, 0, 0);
|
||||
if (excl && rb_str_equal(current, end)) break;
|
||||
if (RSTRING(current)->len > RSTRING(end)->len)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue