diff options
| author | Kenichi Handa | 2009-01-07 06:49:50 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-01-07 06:49:50 +0000 |
| commit | b71f6f7303a0afd764b5954e613cf0140419adca (patch) | |
| tree | 8e30557591895dc95d14f546d1f6acff075dda0c /src/coding.c | |
| parent | 3006c8dcfb577eb0ea0bec01db048f45fb5e7007 (diff) | |
| download | emacs-b71f6f7303a0afd764b5954e613cf0140419adca.tar.gz emacs-b71f6f7303a0afd764b5954e613cf0140419adca.zip | |
(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.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 42 |
1 files changed, 35 insertions, 7 deletions
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) | |||
| 1376 | consumed_chars_base = consumed_chars; | 1376 | consumed_chars_base = consumed_chars; |
| 1377 | 1377 | ||
| 1378 | if (charbuf >= charbuf_end) | 1378 | if (charbuf >= charbuf_end) |
| 1379 | break; | 1379 | { |
| 1380 | if (byte_after_cr >= 0) | ||
| 1381 | src_base--; | ||
| 1382 | break; | ||
| 1383 | } | ||
| 1380 | 1384 | ||
| 1381 | if (byte_after_cr >= 0) | 1385 | if (byte_after_cr >= 0) |
| 1382 | c1 = byte_after_cr, byte_after_cr = -1; | 1386 | c1 = byte_after_cr, byte_after_cr = -1; |
| @@ -1682,7 +1686,11 @@ decode_coding_utf_16 (coding) | |||
| 1682 | consumed_chars_base = consumed_chars; | 1686 | consumed_chars_base = consumed_chars; |
| 1683 | 1687 | ||
| 1684 | if (charbuf + 2 >= charbuf_end) | 1688 | if (charbuf + 2 >= charbuf_end) |
| 1685 | break; | 1689 | { |
| 1690 | if (byte_after_cr1 >= 0) | ||
| 1691 | src_base -= 2; | ||
| 1692 | break; | ||
| 1693 | } | ||
| 1686 | 1694 | ||
| 1687 | if (byte_after_cr1 >= 0) | 1695 | if (byte_after_cr1 >= 0) |
| 1688 | c1 = byte_after_cr1, byte_after_cr1 = -1; | 1696 | c1 = byte_after_cr1, byte_after_cr1 = -1; |
| @@ -2286,7 +2294,11 @@ decode_coding_emacs_mule (coding) | |||
| 2286 | consumed_chars_base = consumed_chars; | 2294 | consumed_chars_base = consumed_chars; |
| 2287 | 2295 | ||
| 2288 | if (charbuf >= charbuf_end) | 2296 | if (charbuf >= charbuf_end) |
| 2289 | break; | 2297 | { |
| 2298 | if (byte_after_cr >= 0) | ||
| 2299 | src_base--; | ||
| 2300 | break; | ||
| 2301 | } | ||
| 2290 | 2302 | ||
| 2291 | if (byte_after_cr >= 0) | 2303 | if (byte_after_cr >= 0) |
| 2292 | c = byte_after_cr, byte_after_cr = -1; | 2304 | c = byte_after_cr, byte_after_cr = -1; |
| @@ -3197,7 +3209,11 @@ decode_coding_iso_2022 (coding) | |||
| 3197 | consumed_chars_base = consumed_chars; | 3209 | consumed_chars_base = consumed_chars; |
| 3198 | 3210 | ||
| 3199 | if (charbuf >= charbuf_end) | 3211 | if (charbuf >= charbuf_end) |
| 3200 | break; | 3212 | { |
| 3213 | if (byte_after_cr >= 0) | ||
| 3214 | src_base--; | ||
| 3215 | break; | ||
| 3216 | } | ||
| 3201 | 3217 | ||
| 3202 | if (byte_after_cr >= 0) | 3218 | if (byte_after_cr >= 0) |
| 3203 | c1 = byte_after_cr, byte_after_cr = -1; | 3219 | c1 = byte_after_cr, byte_after_cr = -1; |
| @@ -4371,7 +4387,11 @@ decode_coding_sjis (coding) | |||
| 4371 | consumed_chars_base = consumed_chars; | 4387 | consumed_chars_base = consumed_chars; |
| 4372 | 4388 | ||
| 4373 | if (charbuf >= charbuf_end) | 4389 | if (charbuf >= charbuf_end) |
| 4374 | break; | 4390 | { |
| 4391 | if (byte_after_cr >= 0) | ||
| 4392 | src_base--; | ||
| 4393 | break; | ||
| 4394 | } | ||
| 4375 | 4395 | ||
| 4376 | if (byte_after_cr >= 0) | 4396 | if (byte_after_cr >= 0) |
| 4377 | c = byte_after_cr, byte_after_cr = -1; | 4397 | c = byte_after_cr, byte_after_cr = -1; |
| @@ -4479,7 +4499,11 @@ decode_coding_big5 (coding) | |||
| 4479 | consumed_chars_base = consumed_chars; | 4499 | consumed_chars_base = consumed_chars; |
| 4480 | 4500 | ||
| 4481 | if (charbuf >= charbuf_end) | 4501 | if (charbuf >= charbuf_end) |
| 4482 | break; | 4502 | { |
| 4503 | if (byte_after_cr >= 0) | ||
| 4504 | src_base--; | ||
| 4505 | break; | ||
| 4506 | } | ||
| 4483 | 4507 | ||
| 4484 | if (byte_after_cr >= 0) | 4508 | if (byte_after_cr >= 0) |
| 4485 | c = byte_after_cr, byte_after_cr = -1; | 4509 | c = byte_after_cr, byte_after_cr = -1; |
| @@ -5144,7 +5168,11 @@ decode_coding_charset (coding) | |||
| 5144 | consumed_chars_base = consumed_chars; | 5168 | consumed_chars_base = consumed_chars; |
| 5145 | 5169 | ||
| 5146 | if (charbuf >= charbuf_end) | 5170 | if (charbuf >= charbuf_end) |
| 5147 | break; | 5171 | { |
| 5172 | if (byte_after_cr >= 0) | ||
| 5173 | src_base--; | ||
| 5174 | break; | ||
| 5175 | } | ||
| 5148 | 5176 | ||
| 5149 | if (byte_after_cr >= 0) | 5177 | if (byte_after_cr >= 0) |
| 5150 | { | 5178 | { |