diff options
| author | Kenichi Handa | 2001-02-05 01:20:55 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2001-02-05 01:20:55 +0000 |
| commit | 3116502899eec4852e1ac780f4597b535377a6bc (patch) | |
| tree | 65d7cb7f730e7275a5d29a7e8ac889058fbba79a /src | |
| parent | 789ce87553de2d2bfdb1f21c28fa19a8a1531742 (diff) | |
| download | emacs-3116502899eec4852e1ac780f4597b535377a6bc.tar.gz emacs-3116502899eec4852e1ac780f4597b535377a6bc.zip | |
(CCL_WRITE_CHAR): Check if CH is valid or not. If
invalid, execute CCL_INVALID_CMD.
(ccl_driver): If the CCL program is terminated because of
CCL_STAT_INVALID_CMD, copy the remaining source data to the
destination instead of throwing them away.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ccl.c | 14 |
1 files changed, 13 insertions, 1 deletions
| @@ -721,8 +721,10 @@ else | |||
| 721 | multibyte form later. */ \ | 721 | multibyte form later. */ \ |
| 722 | extra_bytes++; \ | 722 | extra_bytes++; \ |
| 723 | } \ | 723 | } \ |
| 724 | else \ | 724 | else if (CHAR_VALID_P (ch, 0)) \ |
| 725 | dst += CHAR_STRING (ch, dst); \ | 725 | dst += CHAR_STRING (ch, dst); \ |
| 726 | else \ | ||
| 727 | CCL_INVALID_CMD; \ | ||
| 726 | } \ | 728 | } \ |
| 727 | else \ | 729 | else \ |
| 728 | CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ | 730 | CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ |
| @@ -1781,6 +1783,16 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 1781 | bcopy (msg, dst, msglen); | 1783 | bcopy (msg, dst, msglen); |
| 1782 | dst += msglen; | 1784 | dst += msglen; |
| 1783 | } | 1785 | } |
| 1786 | if (ccl->status == CCL_STAT_INVALID_CMD) | ||
| 1787 | { | ||
| 1788 | /* Copy the remaining source data. */ | ||
| 1789 | int i = src_end - src; | ||
| 1790 | if (dst_bytes && (dst_end - dst) < i) | ||
| 1791 | i = dst_end - dst; | ||
| 1792 | bcopy (src, dst, i); | ||
| 1793 | src += i; | ||
| 1794 | dst += i; | ||
| 1795 | } | ||
| 1784 | } | 1796 | } |
| 1785 | 1797 | ||
| 1786 | ccl_finish: | 1798 | ccl_finish: |