Unverified Commit c33ab7c0 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4469 from dearblue/double-rounds

Fix double rounded by negative index for `String#[]`
parents f455cb6c ecfca8de
......@@ -449,9 +449,6 @@ str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
if (clen == 0) {
len = 0;
}
else if (beg < 0) {
beg = clen + beg;
}
if (beg > clen) return mrb_nil_value();
if (beg < 0) {
beg += clen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment