[MacRuby] #933: String#split(sep, limit) is broken when specified a limit.
#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: ----------------------------------+----------------------------------------- {{{ $ ruby -v -e 'p "USER anonymous".split(" ", 2)' ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] ["USER", "anonymous"] $ ruby19 -v -e 'p "USER anonymous".split(" ", 2)' ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] ["USER", "anonymous"] $ macruby -v -e 'p "USER anonymous".split(" ", 2)' MacRuby 0.8 (ruby 1.9.2) [universal-darwin10.0, x86_64] ["USER anonymous"] }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/933> MacRuby <http://macruby.org/>
#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/>
#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 lsansonetti@…): Feel free to commit if the specs pass :) -- Ticket URL: <http://www.macruby.org/trac/ticket/933#comment:2> MacRuby <http://macruby.org/>
#933: String#split(sep, limit) is broken when specified a limit. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.8 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by watson1978@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.8 Comment: Fixed with r4585 -- Ticket URL: <http://www.macruby.org/trac/ticket/933#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby