1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
usa 2009-12-15 02:50:07 +00:00
parent 8ad9d4edbc
commit d0c1160f73
2 changed files with 6 additions and 1 deletions

View file

@ -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.

View file

@ -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;
}