From 6899b6ff8065daea6f87bfda1ab157738a60f09d Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 29 Jan 2010 00:56:10 +0000 Subject: [PATCH] * enc/trans/utf8_mac.trans (buf_shift_char): don't see uninitialised value. [ruby-dev:40233] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ enc/trans/utf8_mac.trans | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) 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