diff --git a/ChangeLog b/ChangeLog index 058489a49b..c141f593d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 29 09:43:30 2010 NARUSE, Yui + + * enc/trans/utf8_mac.trans (buf_shift_char): don't see uninitialised + value. [ruby-dev:40233] + Fri Jan 29 01:42:24 2010 Yukihiro Matsumoto * lib/delegate.rb (Delegator#initialize_copy): use initialize_copy diff --git a/enc/trans/utf8_mac.trans b/enc/trans/utf8_mac.trans index 7569c34ac0..ecda465355 100644 --- a/enc/trans/utf8_mac.trans +++ b/enc/trans/utf8_mac.trans @@ -85,10 +85,10 @@ buf_shift(struct from_utf8_mac_status *sp) void buf_shift_char(struct from_utf8_mac_status *sp) { - while (sp->beg != sp->end) { + if (sp->beg == sp->end) return; + do { buf_shift(sp); - if ((sp->buf[sp->beg] & 0xC0) != 0x80) break; - } + } while (sp->beg != sp->end && (sp->buf[sp->beg] & 0xC0) == 0x80); } void