aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2003-05-30 07:56:08 +0000
committerKenichi Handa2003-05-30 07:56:08 +0000
commitfd40a25f7128bab94f84155c428087015db3fda1 (patch)
tree0e244167ed5fcabb0a61d9d603ecc9d0e8b14ac0 /src
parentf5a356cdd66f19a5d16726317d24ce0bfcf60003 (diff)
downloademacs-fd40a25f7128bab94f84155c428087015db3fda1.tar.gz
emacs-fd40a25f7128bab94f84155c428087015db3fda1.zip
(CCL_WRITE_CHAR): Increment extra_bytes only when it is
nonzero. (ccl_driver): Initialize extra_bytes to ccl->eight_bit_control. (setup_ccl_program): Initialize ccl->eight_bit_control to zero.
Diffstat (limited to 'src')
-rw-r--r--src/ccl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ccl.c b/src/ccl.c
index e82eea542c2..4a47ca063f3 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -730,7 +730,7 @@ while(0)
730 if (bytes == 1) \ 730 if (bytes == 1) \
731 { \ 731 { \
732 *dst++ = (ch); \ 732 *dst++ = (ch); \
733 if ((ch) >= 0x80 && (ch) < 0xA0) \ 733 if (extra_bytes && (ch) >= 0x80 && (ch) < 0xA0) \
734 /* We may have to convert this eight-bit char to \ 734 /* We may have to convert this eight-bit char to \
735 multibyte form later. */ \ 735 multibyte form later. */ \
736 extra_bytes++; \ 736 extra_bytes++; \
@@ -887,7 +887,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
887 each of them will be converted to multibyte form of 2-byte 887 each of them will be converted to multibyte form of 2-byte
888 sequence. For that conversion, we remember how many more bytes 888 sequence. For that conversion, we remember how many more bytes
889 we must keep in DESTINATION in this variable. */ 889 we must keep in DESTINATION in this variable. */
890 int extra_bytes = 0; 890 int extra_bytes = ccl->eight_bit_control;
891 891
892 if (ic >= ccl->eof_ic) 892 if (ic >= ccl->eof_ic)
893 ic = CCL_HEADER_MAIN; 893 ic = CCL_HEADER_MAIN;
@@ -1905,7 +1905,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
1905 ccl->ic = ic; 1905 ccl->ic = ic;
1906 ccl->stack_idx = stack_idx; 1906 ccl->stack_idx = stack_idx;
1907 ccl->prog = ccl_prog; 1907 ccl->prog = ccl_prog;
1908 ccl->eight_bit_control = (extra_bytes > 0); 1908 ccl->eight_bit_control = (extra_bytes > 1);
1909 if (consumed) 1909 if (consumed)
1910 *consumed = src - source; 1910 *consumed = src - source;
1911 return (dst ? dst - destination : 0); 1911 return (dst ? dst - destination : 0);
@@ -2060,6 +2060,7 @@ setup_ccl_program (ccl, ccl_prog)
2060 ccl->stack_idx = 0; 2060 ccl->stack_idx = 0;
2061 ccl->eol_type = CODING_EOL_LF; 2061 ccl->eol_type = CODING_EOL_LF;
2062 ccl->suppress_error = 0; 2062 ccl->suppress_error = 0;
2063 ccl->eight_bit_control = 0;
2063 return 0; 2064 return 0;
2064} 2065}
2065 2066