aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--string.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ab26854d9..aadef36457 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/string.c b/string.c
index 7781fa4b7e..ca06bf7253 100644
--- a/string.c
+++ b/string.c
@@ -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;
}
}