diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-12-25 00:43:01 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-12-25 00:43:01 +0900 |
| commit | ede04d68b3085c542af5c7d3099f846e3f94be7d (patch) | |
| tree | c74f8bf16d5319b566475e0cd8f93ec1f1683020 /src | |
| parent | 5e3077c00da721ede78c07d2f2e261aded74e7b6 (diff) | |
| parent | 0de65a88d44c108ec5035be2741bed486ad88de5 (diff) | |
| download | mruby-ede04d68b3085c542af5c7d3099f846e3f94be7d.tar.gz mruby-ede04d68b3085c542af5c7d3099f846e3f94be7d.zip | |
Merge pull request #3363 from ksss/string
Do nothing when empty string
Diffstat (limited to 'src')
| -rw-r--r-- | src/string.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c index ce27cdaa1..a177aafba 100644 --- a/src/string.c +++ b/src/string.c @@ -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) { |
