From: Kenichi Handa Date: Wed, 7 Jan 2009 06:49:50 +0000 (+0000) Subject: (decode_coding_utf_8): Check byte_after_cr before breaking the loop. X-Git-Tag: emacs-pretest-23.0.90~664 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b71f6f7303a0afd764b5954e613cf0140419adca;p=emacs.git (decode_coding_utf_8): Check byte_after_cr before breaking the loop. (decode_coding_utf_16, decode_coding_emacs_mule) (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5) (decode_coding_charset): Likewise. --- diff --git a/src/ChangeLog b/src/ChangeLog index 9052a2105a8..25b60e9d45e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2009-01-07 Kenichi Handa + + * coding.c (decode_coding_utf_8): Check byte_after_cr before + breaking the loop. + (decode_coding_utf_16, decode_coding_emacs_mule) + (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5) + (decode_coding_charset): Likewise. + 2009-01-05 Martin Rudalics * frame.c (x_set_frame_parameters): Make sure height (width) get diff --git a/src/coding.c b/src/coding.c index 869a2715640..1e86ae8f777 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1376,7 +1376,11 @@ decode_coding_utf_8 (coding) consumed_chars_base = consumed_chars; if (charbuf >= charbuf_end) - break; + { + if (byte_after_cr >= 0) + src_base--; + break; + } if (byte_after_cr >= 0) c1 = byte_after_cr, byte_after_cr = -1; @@ -1682,7 +1686,11 @@ decode_coding_utf_16 (coding) consumed_chars_base = consumed_chars; if (charbuf + 2 >= charbuf_end) - break; + { + if (byte_after_cr1 >= 0) + src_base -= 2; + break; + } if (byte_after_cr1 >= 0) c1 = byte_after_cr1, byte_after_cr1 = -1; @@ -2286,7 +2294,11 @@ decode_coding_emacs_mule (coding) consumed_chars_base = consumed_chars; if (charbuf >= charbuf_end) - break; + { + if (byte_after_cr >= 0) + src_base--; + break; + } if (byte_after_cr >= 0) c = byte_after_cr, byte_after_cr = -1; @@ -3197,7 +3209,11 @@ decode_coding_iso_2022 (coding) consumed_chars_base = consumed_chars; if (charbuf >= charbuf_end) - break; + { + if (byte_after_cr >= 0) + src_base--; + break; + } if (byte_after_cr >= 0) c1 = byte_after_cr, byte_after_cr = -1; @@ -4371,7 +4387,11 @@ decode_coding_sjis (coding) consumed_chars_base = consumed_chars; if (charbuf >= charbuf_end) - break; + { + if (byte_after_cr >= 0) + src_base--; + break; + } if (byte_after_cr >= 0) c = byte_after_cr, byte_after_cr = -1; @@ -4479,7 +4499,11 @@ decode_coding_big5 (coding) consumed_chars_base = consumed_chars; if (charbuf >= charbuf_end) - break; + { + if (byte_after_cr >= 0) + src_base--; + break; + } if (byte_after_cr >= 0) c = byte_after_cr, byte_after_cr = -1; @@ -5144,7 +5168,11 @@ decode_coding_charset (coding) consumed_chars_base = consumed_chars; if (charbuf >= charbuf_end) - break; + { + if (byte_after_cr >= 0) + src_base--; + break; + } if (byte_after_cr >= 0) {