diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | string.c | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Wed Feb 4 21:57:37 2009 Tanaka Akira <akr@fsij.org> + + * string.c (rb_str_dump): use MBCLEN_CHARFOUND_P properly. + Wed Feb 4 21:55:38 2009 Tanaka Akira <akr@fsij.org> * bootstraptest/runner.rb: refine success message. @@ -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; } } |