summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-02 16:20:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-02 16:20:16 +0000
commit004a9f77c562320486c25384edf55b6186f22107 (patch)
tree2178c5ed3a256ec17291c99c7ddf18bcedf073b6 /string.c
parent0bf031acce35b2bac5d0a07189258a46e3725aa4 (diff)
* string.c (rb_str_inspect): encode \b (\010) for escape.
[ruby-dev:28927] * string.c (rb_str_dump): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/string.c b/string.c
index ff3ded9..b5fc5f3 100644
--- a/string.c
+++ b/string.c
@@ -2601,6 +2601,10 @@ rb_str_inspect(str)
s[0] = '\\'; s[1] = 'v';
rb_str_buf_cat(result, s, 2);
}
+ else if (c == '\010') {
+ s[0] = '\\'; s[1] = 'b';
+ rb_str_buf_cat(result, s, 2);
+ }
else if (c == '\007') {
s[0] = '\\'; s[1] = 'a';
rb_str_buf_cat(result, s, 2);
@@ -2704,6 +2708,10 @@ rb_str_dump(str)
*q++ = '\\';
*q++ = 'v';
}
+ else if (c == '\010') {
+ *q++ = '\\';
+ *q++ = 'b';
+ }
else if (c == '\007') {
*q++ = '\\';
*q++ = 'a';