Fix ticket:74
authorRaymond Toy <toy.raymond@gmail.com>
Wed, 27 Feb 2013 04:44:18 +0000 (20:44 -0800)
committerRaymond Toy <toy.raymond@gmail.com>
Wed, 27 Feb 2013 04:44:18 +0000 (20:44 -0800)
When accounting for the octets left in the in-buffer that we haven't
read (or converted to characters), we were subtracting the index from
the total in-buffer length.  This is wrong if the file is less than
the total in-buffer length.  We should have subtracted from the actual
number of octets in the in-buffer.

src/code/fd-stream.lisp

index e41b331..7fcd0bc 100644 (file)
                   #+nil
                   (progn
                     (format t "in-buffer-length = ~D~%" in-buffer-length)
+                    (format t "in-length = ~D~%" (fd-stream-in-length stream))
                     (format t "fd-stream-in-index = ~D~%" (fd-stream-in-index stream)))
-                  (decf posn (- in-buffer-length
+                  (decf posn (- (fd-stream-in-length stream)
                                 (fd-stream-in-index stream))))
                 #+nil
                 (format t "fd-stream-unread = ~S~%" (fd-stream-unread stream))