diff options
| author | Kenichi Handa | 2000-05-19 23:51:55 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-05-19 23:51:55 +0000 |
| commit | bd045987c20414ae1de41518d39dcb34e652b696 (patch) | |
| tree | a3cd64d935a5e4d09c6375299aeff75c6e40d7f5 | |
| parent | 75ec644a43f9f4b9e7316f5c4b42f99314c89ebe (diff) | |
| download | emacs-bd045987c20414ae1de41518d39dcb34e652b696.tar.gz emacs-bd045987c20414ae1de41518d39dcb34e652b696.zip | |
(CCL_WRITE_CHAR): Be sure to write single byte characters
as is.
(CCL_MAKE_CHAR): Use MAKE_CHAR, not MAKE_NON_ASCII_CHAR.
| -rw-r--r-- | src/ccl.c | 19 |
1 files changed, 9 insertions, 10 deletions
| @@ -668,19 +668,18 @@ static tr_stack *mapping_stack_pointer; | |||
| 668 | output buffer. If CH is less than 256, CH is written as is. */ | 668 | output buffer. If CH is less than 256, CH is written as is. */ |
| 669 | #define CCL_WRITE_CHAR(ch) \ | 669 | #define CCL_WRITE_CHAR(ch) \ |
| 670 | do { \ | 670 | do { \ |
| 671 | int bytes = SINGLE_BYTE_CHAR_P (ch) ? 1: CHAR_BYTES (ch); \ | ||
| 671 | if (!dst) \ | 672 | if (!dst) \ |
| 672 | CCL_INVALID_CMD; \ | 673 | CCL_INVALID_CMD; \ |
| 673 | else \ | 674 | else if (dst + bytes <= (dst_bytes ? dst_end : src)) \ |
| 674 | { \ | 675 | { \ |
| 675 | unsigned char str[MAX_MULTIBYTE_LENGTH], *p = str; \ | 676 | if (bytes == 1) \ |
| 676 | int len = CHAR_STRING (ch, str); \ | 677 | *dst++ = (ch); \ |
| 677 | if (dst + len <= (dst_bytes ? dst_end : src)) \ | ||
| 678 | { \ | ||
| 679 | while (len--) *dst++ = *p++; \ | ||
| 680 | } \ | ||
| 681 | else \ | 678 | else \ |
| 682 | CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ | 679 | dst += CHAR_STRING (ch, dst); \ |
| 683 | } \ | 680 | } \ |
| 681 | else \ | ||
| 682 | CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ | ||
| 684 | } while (0) | 683 | } while (0) |
| 685 | 684 | ||
| 686 | /* Write a string at ccl_prog[IC] of length LEN to the current output | 685 | /* Write a string at ccl_prog[IC] of length LEN to the current output |
| @@ -732,10 +731,10 @@ static tr_stack *mapping_stack_pointer; | |||
| 732 | \ | 731 | \ |
| 733 | if (code >= 256) \ | 732 | if (code >= 256) \ |
| 734 | c2 = c1, c1 = (code >> 7) & 0x7F; \ | 733 | c2 = c1, c1 = (code >> 7) & 0x7F; \ |
| 735 | c = MAKE_NON_ASCII_CHAR (charset, c1, c2); \ | 734 | c = MAKE_CHAR (charset, c1, c2); \ |
| 736 | } \ | 735 | } \ |
| 737 | else \ | 736 | else \ |
| 738 | c = code & 0xFF; \ | 737 | c = code & 0xFF; \ |
| 739 | } while (0) | 738 | } while (0) |
| 740 | 739 | ||
| 741 | 740 | ||