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

Merge pull request #3363 from ksss/string

Do nothing when empty string
parents 5e3077c0 0de65a88
...@@ -754,6 +754,9 @@ mrb_str_concat(mrb_state *mrb, mrb_value self, mrb_value other) ...@@ -754,6 +754,9 @@ mrb_str_concat(mrb_state *mrb, mrb_value self, mrb_value other)
other = mrb_str_to_str(mrb, other); other = mrb_str_to_str(mrb, other);
} }
s2 = mrb_str_ptr(other); s2 = mrb_str_ptr(other);
if (RSTR_LEN(s2) == 0) {
return;
}
len = RSTR_LEN(s1) + RSTR_LEN(s2); len = RSTR_LEN(s1) + RSTR_LEN(s2);
if (RSTRING_CAPA(self) < len) { if (RSTRING_CAPA(self) < len) {
......
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