X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-simple-streams%2Fimpl.lisp;h=3512edfaa84aa40dba82b58eaa94ca4792d48c57;hb=f057566fe993f008a9b34dc87b026e7c8ef2611d;hp=014c8520c455decc60be45a2d93d4c166eea1a37;hpb=be6abfb75a76eb69a417ff09fd6b0f41e708f8c3;p=sbcl.git diff --git a/contrib/sb-simple-streams/impl.lisp b/contrib/sb-simple-streams/impl.lisp index 014c852..3512edf 100644 --- a/contrib/sb-simple-streams/impl.lisp +++ b/contrib/sb-simple-streams/impl.lisp @@ -584,10 +584,12 @@ (index (or start 0) (1+ index)) (end (or end (* (length vector) (vector-elt-width vector)))) (endian-swap (endian-swap-value vector endian-swap)) - (byte (read-byte-internal encap nil nil t) - (read-byte-internal encap nil nil nil))) - ((or (null byte) (>= index end)) index) - (setf (bref vector (logxor index endian-swap)) byte)))))) + (flag t nil)) + ((>= index end) index) + (let ((byte (read-byte-internal encap nil nil flag))) + (unless byte + (return index)) + (setf (bref vector (logxor index endian-swap)) byte))))))) ((or ansi-stream fundamental-stream) (unless (typep vector '(or string (simple-array (signed-byte 8) (*)) @@ -711,7 +713,11 @@ (remf options :input-handle) (remf options :output-handle) (make-instance class :lisp-stream - (apply #'open-fd-stream filespec options)))))) + (apply #'open-fd-stream filespec options))) + (t (error "Don't know how to handle the stream class ~A" + (etypecase class + (symbol (find-class class t)) + (class class))))))) (declaim (inline read-byte read-char read-char-no-hang unread-char))