Merge pull request #3363 from ksss/string

Do nothing when empty string
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-12-25 00:43:01 +09:00
committed by GitHub
+3
View File
@@ -754,6 +754,9 @@ mrb_str_concat(mrb_state *mrb, mrb_value self, mrb_value other)
other = mrb_str_to_str(mrb, other);
}
s2 = mrb_str_ptr(other);
if (RSTR_LEN(s2) == 0) {
return;
}
len = RSTR_LEN(s1) + RSTR_LEN(s2);
if (RSTRING_CAPA(self) < len) {