diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | enc/trans/utf8_mac.trans | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Fri Jan 29 09:43:30 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * 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 <matz@ruby-lang.org> * 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 |