diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-04 12:58:30 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-04 12:58:30 +0000 |
commit | 6ae8b15d939e12c25740864c119aff1886d5c350 (patch) | |
tree | 00acc72229d17531a0125224f67bad63f85752d4 /string.c | |
parent | c77f323088fe118191dc0ea62e283114a6b00589 (diff) | |
download | ruby-6ae8b15d939e12c25740864c119aff1886d5c350.tar.gz |
* string.c (rb_str_dump): use MBCLEN_CHARFOUND_P properly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4186,12 +4186,12 @@ rb_str_dump(VALUE str) else { if (u8) { /* \u{NN} */ char buf[32]; - int n = rb_enc_precise_mbclen(p-1, pend, enc) - 1; + int n = rb_enc_precise_mbclen(p-1, pend, enc); if (MBCLEN_CHARFOUND_P(n)) { int cc = rb_enc_codepoint(p-1, pend, enc); sprintf(buf, "%x", cc); len += strlen(buf)+4; - p += n; + p += MBCLEN_CHARFOUND_LEN(n)-1; break; } } |