Issue #5830 has been updated by Yui NARUSE.

Status changed from Open to Rejected

It's spec.

It follows String#slice's behavior; it returns "" for str.slice(str.length, 0).
irb(main):005:0> ["a".slice(1), "a".slice(1, 0)]
=> [nil, ""]

----------------------------------------
Bug #5830: "".byteslice(0) != "".byteslice(0, 0)
https://bugs.ruby-lang.org/issues/5830

Author: Brian Ford
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]


Is this a bug?

See https://github.com/ruby/ruby/blob/069f7ec90a6ef/string.c#L4091 vs https://github.com/ruby/ruby/blob/069f7ec90a6ef/string.c#L4035-4036

Thanks,
Brian


-- 
http://redmine.ruby-lang.org