[babel-devel] Unibyte decoders/encoders return wrong values

Ariel Badichi vermilionrush at gmail.com
Sun Nov 29 01:15:02 UTC 2009


Hello,

Unibyte decoders/encoders return (- START END) rather than (- END START).
Patch follows.

Ariel

diff -rN -u old-babel/src/encodings.lisp new-babel/src/encodings.lisp
--- old-babel/src/encodings.lisp	2009-11-29 03:01:45.000000000 +0200
+++ new-babel/src/encodings.lisp	2009-11-29 03:01:45.000000000 +0200
@@ -375,7 +375,7 @@
                      (declare (type code-point ,',code))
                      (block ,',encoding ,@',body)))
                  ,',dest ,',di)
-                finally (return (the fixnum (- ,',d-start ,',di))))))))
+                finally (return (the fixnum (- ,',di ,',d-start))))))))
 
 ;;; The decoder version of the above macro.
 (defmacro define-unibyte-decoder (encoding (octet) &body body)
@@ -400,7 +400,7 @@
                      (declare (type ub8 ,',octet))
                      (block ,',encoding ,@',body)))
                  ,',dest ,',di)
-                finally (return (the fixnum (- ,',d-start ,',di))))))))
+                finally (return (the fixnum (- ,',di ,',d-start))))))))
 
 ;;;; Error Conditions
 ;;;





More information about the babel-devel mailing list