aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2009-06-16 02:04:25 +0000
committerKenichi Handa2009-06-16 02:04:25 +0000
commitcc13543e84480b8361da607ba9b859c9bd2f42d5 (patch)
treef9837d577556a757ceaad25c5b61006fa4442762 /src/coding.c
parent9c6d2887cd59552a64247426dbfddfc8a610b2ee (diff)
downloademacs-cc13543e84480b8361da607ba9b859c9bd2f42d5.tar.gz
emacs-cc13543e84480b8361da607ba9b859c9bd2f42d5.zip
(detect_coding_utf_16): Fix previous change.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/coding.c b/src/coding.c
index 8d90297db0f..cde56d9af42 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1665,10 +1665,11 @@ detect_coding_utf_16 (coding, detect_info)
1665 e[c1] = 1; 1665 e[c1] = 1;
1666 o[c2] = 1; 1666 o[c2] = 1;
1667 1667
1668 detect_info->rejected 1668 detect_info->rejected |= (CATEGORY_MASK_UTF_16_AUTO
1669 |= (CATEGORY_MASK_UTF_16_BE | CATEGORY_MASK_UTF_16_LE); 1669 |CATEGORY_MASK_UTF_16_BE
1670 | CATEGORY_MASK_UTF_16_LE);
1670 1671
1671 while (1) 1672 while (detect_info->rejected != CATEGORY_MASK_UTF_16)
1672 { 1673 {
1673 TWO_MORE_BYTES (c1, c2); 1674 TWO_MORE_BYTES (c1, c2);
1674 if (c2 < 0) 1675 if (c2 < 0)
@@ -1677,18 +1678,17 @@ detect_coding_utf_16 (coding, detect_info)
1677 { 1678 {
1678 e[c1] = 1; 1679 e[c1] = 1;
1679 e_num++; 1680 e_num++;
1680 if (e_num >= 128 && o_num >= 128) 1681 if (e_num >= 128)
1681 break; 1682 detect_info->rejected |= CATEGORY_MASK_UTF_16_BE_NOSIG;
1682 } 1683 }
1683 if (! o[c2]) 1684 if (! o[c2])
1684 { 1685 {
1685 o[c2] = 1; 1686 o[c2] = 1;
1686 o_num++; 1687 o_num++;
1687 if (e_num >= 128 && o_num >= 128) 1688 if (o_num >= 128)
1688 break; 1689 detect_info->rejected |= CATEGORY_MASK_UTF_16_LE_NOSIG;
1689 } 1690 }
1690 } 1691 }
1691 detect_info->rejected |= CATEGORY_MASK_UTF_16;
1692 return 0; 1692 return 0;
1693 } 1693 }
1694 1694