Check for overlong sequences rejected too much
Wed Sep 7 01:41:10 PDT 2011 marijnh@gmail.com
* Check for overlong sequences rejected too much
A code point like #x0800, which exactly fits in 3 bytes, would be
rejected because a > was used where >= was needed.
diff -rN -u old-trivial-utf-8/trivial-utf-8.lisp new-trivial-utf-8/trivial-utf-8.lisp
--- old-trivial-utf-8/trivial-utf-8.lisp 2014-07-12 01:00:27.000000000 -0700
+++ new-trivial-utf-8/trivial-utf-8.lisp 2014-07-12 01:00:27.000000000 -0700
@@ -141,7 +141,7 @@
(test-overlong (byte min-size)
(let ((b (gensym)))
`(let ((,b ,byte))
- (unless (> ,b ,min-size)
+ (unless (>= ,b ,min-size)
(error 'utf-8-decoding-error :byte ,b
:message "Overlong byte sequence found."))
,b))))