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
7138 7138

  
7139 7139
    beg = RSTRING_PTR(str);
7140 7140
    end = beg + RSTRING_LEN(str);
7141
    if (beg > end) return 0;
7141
    if (beg >= end) return 0;
7142 7142
    p = rb_enc_prev_char(beg, end, end, enc);
7143 7143
    if (!p) return 0;
7144 7144
    if (p > beg && rb_enc_ascget(p, end, 0, enc) == '\n') {