[MacRuby] #933: String#split(sep, limit) is broken when specified a limit.
MacRuby
ruby-noreply at macosforge.org
Tue Oct 5 22:36:02 PDT 2010
#933: String#split(sep, limit) is broken when specified a limit.
----------------------------------+-----------------------------------------
Reporter: watson1978@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
----------------------------------+-----------------------------------------
Comment(by watson1978@…):
I atach a patch.
{{{
#!diff
diff --git a/string.c b/string.c
index e16bbe1..40bd513 100644
--- a/string.c
+++ b/string.c
@@ -3167,9 +3167,10 @@ fs_set:
rb_ary_push(result, substr);
}
beg = i + 1;
- }
- if (limit != Qnil && --lim <= 0) {
- break;
+
+ if (limit != Qnil && --lim <= 1) {
+ break;
+ }
}
}
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/933#comment:1>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list