mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fix the issue String#slice with Range may return broken String.
This commit is contained in:
+1
-1
@@ -286,7 +286,7 @@ mrb_range_beg_len(mrb_state *mrb, mrb_value range, mrb_int *begp, mrb_int *lenp,
|
||||
if (end > len) end = len;
|
||||
}
|
||||
if (end < 0) end += len;
|
||||
if (!r->excl) end++; /* include end point */
|
||||
if (!r->excl && end < len) end++; /* include end point */
|
||||
len = end - beg;
|
||||
if (len < 0) len = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user