Unverified Commit 2f0bf1e1 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4785 from shuujii/fix-incorrect-MRB_STR_ASCII-flag-update-in-mrb_str_dump

Fix incorrect `MRB_STR_ASCII` flag update in `mrb_str_dump`
parents 1aacde20 41c43234
...@@ -1388,8 +1388,13 @@ str_escape(mrb_state *mrb, mrb_value str, mrb_bool inspect) ...@@ -1388,8 +1388,13 @@ str_escape(mrb_state *mrb, mrb_value str, mrb_bool inspect)
} }
mrb_str_cat_lit(mrb, result, "\""); mrb_str_cat_lit(mrb, result, "\"");
#ifdef MRB_UTF8_STRING #ifdef MRB_UTF8_STRING
if (inspect) {
mrb_str_ptr(str)->flags |= ascii_flag; mrb_str_ptr(str)->flags |= ascii_flag;
mrb_str_ptr(result)->flags |= ascii_flag; mrb_str_ptr(result)->flags |= ascii_flag;
}
else {
RSTR_SET_ASCII_FLAG(mrb_str_ptr(result));
}
#endif #endif
return result; return result;
......
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