diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-02 16:20:16 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-02 16:20:16 +0000 |
| commit | 29294a9d3d4ac66880cbd684ef7a31c279821150 (patch) | |
| tree | 2178c5ed3a256ec17291c99c7ddf18bcedf073b6 | |
| parent | d6a58d4be53f83f884ac1a385f5a2e42dbedd71c (diff) | |
| download | ruby-29294a9d3d4ac66880cbd684ef7a31c279821150.tar.gz ruby-29294a9d3d4ac66880cbd684ef7a31c279821150.tar.xz ruby-29294a9d3d4ac66880cbd684ef7a31c279821150.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/branches/ruby_1_8@10454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | string.c | 8 |
2 files changed, 15 insertions, 0 deletions
@@ -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). @@ -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'; |
