mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Remove the escape backslash from the result string.
This commit is contained in:
+9
-2
@@ -249,8 +249,15 @@ mrb_vformat(mrb_state *mrb, const char *format, va_list ap)
|
||||
}
|
||||
}
|
||||
else if (c == '\\') {
|
||||
if (!*p) break;
|
||||
p++;
|
||||
if (*p) {
|
||||
size = p - b - 1;
|
||||
mrb_ary_push(mrb, ary, mrb_str_new(mrb, b, size));
|
||||
mrb_ary_push(mrb, ary, mrb_str_new(mrb, p, 1));
|
||||
b = ++p;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user