summaryrefslogtreecommitdiffstats
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
commita1774dd706a5733c98a8a0a0be591522a1c6ad2a (patch)
treecfbf791229b9231edb19c5fb15856867bfc1bd31 /string.c
parentabd574a80af2627ed13ee7a60de451402fe2ffe4 (diff)
downloadruby-a1774dd706a5733c98a8a0a0be591522a1c6ad2a.tar.gz
ruby-a1774dd706a5733c98a8a0a0be591522a1c6ad2a.tar.xz
ruby-a1774dd706a5733c98a8a0a0be591522a1c6ad2a.zip
* string.c (rb_str_inspect): encode \b (\010) for escape.
[ruby-dev:28927] * string.c (rb_str_dump): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@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 96f93808c..709014061 100644
--- a/string.c
+++ b/string.c
@@ -2449,6 +2449,10 @@ rb_str_inspect(VALUE 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);
@@ -2551,6 +2555,10 @@ rb_str_dump(VALUE str)
*q++ = '\\';
*q++ = 'v';
}
+ else if (c == '\010') {
+ *q++ = '\\';
+ *q++ = 'b';
+ }
else if (c == '\007') {
*q++ = '\\';
*q++ = 'a';