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_dump): use MBCLEN_CHARFOUND_P properly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-02-04 12:58:30 +00:00
parent c77f323088
commit 6ae8b15d93
2 changed files with 6 additions and 2 deletions

View file

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

View file

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