Project

General

Profile

Bug #11391 ยป 0001-string.c-chopped_length-early-return-for-empty-strin.patch

cesario (Franck Verrot), 07/23/2015 08:17 AM

View differences:

string.c
beg = RSTRING_PTR(str);
end = beg + RSTRING_LEN(str);
if (beg > end) return 0;
if (beg >= end) return 0;
p = rb_enc_prev_char(beg, end, end, enc);
if (!p) return 0;
if (p > beg && rb_enc_ascget(p, end, 0, enc) == '\n') {
    (1-1/1)