Permalink
Browse files

Should not make empty strings shared; fix #3407

  • Loading branch information...
matz committed Jan 23, 2017
1 parent 49fd759 commit 708088c5fafd469d04a1b428fc49b8b7c27607d2
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/string.c
View
@@ -423,7 +423,7 @@ byte_subseq(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len)
mrb_shared_string *shared;
orig = mrb_str_ptr(str);
if (RSTR_EMBED_P(orig)) {
if (RSTR_EMBED_P(orig) || RSTR_LEN(orig) == 0) {
s = str_new(mrb, orig->as.ary+beg, len);
}
else {

0 comments on commit 708088c

Please sign in to comment.