Remove the escape backslash from the result string.

This commit is contained in:
Masaki Muranaka
2013-03-28 15:07:34 +09:00
parent e265d7c7ef
commit 9c831c9a9c
+9 -2
View File
@@ -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++;
}