diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-15 02:50:07 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-15 02:50:07 +0000 |
| commit | d0c1160f7322b49091c546067c5888744aa4eef7 (patch) | |
| tree | c670d111ada38b80a0cf9f78030259198d7aba5e | |
| parent | 8ad9d4edbcf0ffdee1fedbecbf79b71cfbd4c006 (diff) | |
* string.c (rb_str_inspect): wrong result of UTF-8 inspect because of
the mistake of calculation. reported by eban via IRC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | string.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Dec 15 11:48:41 2009 NAKAMURA Usaku <usa@ruby-lang.org> + + * string.c (rb_str_inspect): wrong result of UTF-8 inspect because of + the mistake of calculation. reported by eban via IRC. + Sun Dec 13 23:07:05 2009 NAKAMURA, Hiroshi <nahi@ruby-lang.org> * test/openssl/*: added some tests from jruby-openssl. @@ -2719,7 +2719,7 @@ rb_str_inspect(str) while (p < pend) { char c = *p++; int len; - if (ismbchar(c) && p + (len = mbclen(c)) <= pend) { + if (ismbchar(c) && p - 1 + (len = mbclen(c)) <= pend) { rb_str_buf_cat(result, p - 1, len); p += len - 1; } |
