mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-string-ext (str_b): String#b should copy the receiver
This commit is contained in:
@@ -1352,8 +1352,9 @@ str_ascii_only_p(mrb_state *mrb, mrb_value str)
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
str_b(mrb_state *mrb, mrb_value str)
|
||||
str_b(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value str = mrb_str_dup(mrb, self);
|
||||
mrb_str_ptr(str)->flags |= MRB_STR_BINARY;
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user