Escape unprintable chars only, without surrounding quotes

This commit is contained in:
Nobuyoshi Nakada 2021-07-24 14:24:18 +09:00
parent 8cc18703cf
commit eec45a93ef
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2021-07-24 17:59:09 +09:00
4 changed files with 6 additions and 10 deletions

View file

@ -1121,7 +1121,7 @@ ruby__sfvextra(rb_printf_buffer *fp, size_t valsize, void *valp, long *sz, int s
else if (SYMBOL_P(value)) {
value = rb_sym2str(value);
if (sign == ' ' && !rb_str_symname_p(value)) {
value = rb_str_inspect(value);
value = rb_str_escape(value);
}
}
else {