Project

General

Profile

Bug #13925 ยป partition_rpartition.patch

hanachin (Seiei Miyagi), 09/20/2017 11:44 PM

View differences:

string.c
9124 9124
	pos = rb_reg_search(sep, str, 0, 0);
9125 9125
	if (pos < 0) {
9126 9126
	  failed:
9127
	    return rb_ary_new3(3, str, str_new_empty(str), str_new_empty(str));
9127
	    return rb_ary_new3(3, rb_str_dup(str), str_new_empty(str), str_new_empty(str));
9128 9128
	}
9129 9129
	sep = rb_str_subpat(str, sep, INT2FIX(0));
9130 9130
	if (pos == 0 && RSTRING_LEN(sep) == 0) goto failed;
......
9177 9177
	pos = rb_str_rindex(str, sep, pos);
9178 9178
    }
9179 9179
    if (pos < 0) {
9180
	return rb_ary_new3(3, str_new_empty(str), str_new_empty(str), str);
9180
	return rb_ary_new3(3, str_new_empty(str), str_new_empty(str), rb_str_dup(str));
9181 9181
    }
9182 9182
    if (regex) {
9183 9183
	sep = rb_reg_nth_match(0, rb_backref_get());