diff options
author | Kenichi Handa <handa@m17n.org> | 2001-02-05 01:20:55 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2001-02-05 01:20:55 +0000 |
commit | 3116502899eec4852e1ac780f4597b535377a6bc (patch) | |
tree | 65d7cb7f730e7275a5d29a7e8ac889058fbba79a /src/ccl.c | |
parent | 789ce87553de2d2bfdb1f21c28fa19a8a1531742 (diff) | |
download | emacs-3116502899eec4852e1ac780f4597b535377a6bc.tar.gz |
(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/ccl.c')
-rw-r--r-- | src/ccl.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ccl.c b/src/ccl.c index f5f024bf8d6..45cc525112d 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -721,8 +721,10 @@ else multibyte form later. */ \ extra_bytes++; \ } \ - else \ + else if (CHAR_VALID_P (ch, 0)) \ dst += CHAR_STRING (ch, dst); \ + else \ + CCL_INVALID_CMD; \ } \ else \ CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ @@ -1781,6 +1783,16 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) bcopy (msg, dst, msglen); dst += msglen; } + if (ccl->status == CCL_STAT_INVALID_CMD) + { + /* Copy the remaining source data. */ + int i = src_end - src; + if (dst_bytes && (dst_end - dst) < i) + i = dst_end - dst; + bcopy (src, dst, i); + src += i; + dst += i; + } } ccl_finish: |