commit e1654e6d137ff8d5c482db5fcdc1a52c3f48a349 parent 9b9f6c0ef9d80a82598e3ce159f8769a3198339f Author: Tomas Hlavaty <tom@logand.com> Date: Fri, 14 Feb 2014 09:48:19 +0100 fix biff-continue-stream Diffstat:
M | olefs.lisp | | | 16 | +++++++++------- |
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/olefs.lisp b/olefs.lisp @@ -1679,13 +1679,15 @@ (physical-stream-position (physical-stream-position stream)) (read-octet (unless (< offset size) - (if (eql #x3c (read-ushort stream)) ;; continue record - (let ((n (read-ushort stream))) ;; 2080 biff2-5, 8224 biff8 - (assert (member n '(2080 8224))) - (incf size n) - (when *reading-unicode-string* - (assert (equal *reading-unicode-string* (read-octet stream))))) ;; TODO can change - (error 'end-of-file :stream self))) + (when (eql #x3c (read-ushort stream)) ;; continue record + (let ((n (read-ushort stream))) + (assert (< 0 n 8225)) ;; TODO biff8 or 2081 biff2-5 + (incf size n) + (when *reading-unicode-string* + (assert (equal *reading-unicode-string* (read-octet stream))) ;; TODO can change + (decf size))))) + (unless (< offset size) + (error 'end-of-file :stream self)) (incf offset) (read-octet stream)))))))