summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--string.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 01b5658625..b035cff689 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Jul 3 01:14:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_inspect): encode \b (\010) for escape.
+ [ruby-dev:28927]
+
+ * string.c (rb_str_dump): ditto.
+
Sun Jul 2 19:17:56 2006 Minero Aoki <aamine@loveruby.net>
* ext/racc/cparse/cparse.c: sync with original code (rev 1.7).
diff --git a/string.c b/string.c
index ff3ded900a..b5fc5f3446 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';