Commit a94be455 authored by h2so5's avatar h2so5

change behavior of mrb_sym2str

parent 83c45e73
......@@ -381,14 +381,9 @@ mrb_sym2str(mrb_state *mrb, mrb_sym sym)
{
size_t len;
const char *name = mrb_sym2name_len(mrb, sym, &len);
mrb_value str;
if (!name) return mrb_undef_value(); /* can't happen */
str = mrb_str_new_static(mrb, name, len);
if (symname_p(name) && strlen(name) == len) {
return str;
}
return mrb_str_dump(mrb, str);
return mrb_str_new_static(mrb, name, len);
}
const char*
......
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