diff options
| author | Kenichi Handa | 2003-05-30 07:56:08 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-05-30 07:56:08 +0000 |
| commit | fd40a25f7128bab94f84155c428087015db3fda1 (patch) | |
| tree | 0e244167ed5fcabb0a61d9d603ecc9d0e8b14ac0 /src | |
| parent | f5a356cdd66f19a5d16726317d24ce0bfcf60003 (diff) | |
| download | emacs-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -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 | ||