(ccl-decode-mule-utf-8): Fix a bug of

invalid 5 to 6 bytes sequence.
This commit is contained in:
Kenichi Handa 2003-03-19 23:36:15 +00:00
parent 0b51ba8a5a
commit 76b7fded09
2 changed files with 19 additions and 12 deletions

View file

@ -1,3 +1,8 @@
2003-03-20 Kenichi Handa <handa@m17n.org>
* international/utf-8.el (ccl-decode-mule-utf-8): Fix a bug in
handling invalid 5 to 6 bytes sequence.
2003-03-19 Simon Marshall <simon@gnu.org>
* progmodes/make-mode.el (makefile-font-lock-syntactic-keywords):

View file

@ -479,19 +479,21 @@ default. Also, installing them may be rather slow."
(write-multibyte-character r5 r3))
(write-multibyte-character r6 r3))
(if (r0 >= #xf8) ; 5- or 6-byte encoding
((read r1)
(if (r1 < #xa0)
(if (r1 < #x80) ; invalid byte
(write r1)
(write-multibyte-character r5 r1))
(write-multibyte-character r6 r1))
((r0 = -1)
(read r0)
(if (r0 < #xa0)
(if (r0 < #x80) ; invalid byte
(write r0)
(write-multibyte-character r5 r0))
(write-multibyte-character r6 r0))
(if (r0 >= #xfc) ; 6-byte
((read r1)
(if (r1 < #xa0)
(if (r1 < #x80) ; invalid byte
(write r1)
(write-multibyte-character r5 r1))
(write-multibyte-character r6 r1)))))))
((r0 = -1)
(read r0)
(if (r0 < #xa0)
(if (r0 < #x80) ; invalid byte
(write r0)
(write-multibyte-character r5 r0))
(write-multibyte-character r6 r0)))))))
;; else invalid byte >= #xfe
(write-multibyte-character r6 r0))))))
(repeat)))