Commit 045a9cad authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1614 from h2so5/change-sym2str

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