summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-24 14:24:18 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-07-24 14:31:41 +0900
commiteec45a93effe69a821960839760b9e39be1ebc63 (patch)
tree0f3ab0bab09728300ecd9ffcef6179d9ce6f9661 /sprintf.c
parent8cc18703cfa7ff88b6ca51267e557fa2658a78fb (diff)
Escape unprintable chars only, without surrounding quotes
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4676
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index f54336fca5..693b30bd8b 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -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 {