X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-simple-streams%2Fimpl.lisp;h=07732f32009acba532bc430250b036eed85e7072;hb=4fd24714c780827eec742db55297940ed7160ea7;hp=c6b696cd4fb7893be554dd89ef85c42ed395e126;hpb=c364434c07423e4b033f286397667b3fe0310e97;p=sbcl.git diff --git a/contrib/sb-simple-streams/impl.lisp b/contrib/sb-simple-streams/impl.lisp index c6b696c..07732f3 100644 --- a/contrib/sb-simple-streams/impl.lisp +++ b/contrib/sb-simple-streams/impl.lisp @@ -126,7 +126,7 @@ (if (typep stream 'file-simple-stream) (with-stream-class (file-simple-stream stream) (setf (sm pathname stream) new-name) - (setf (sm filename stream) (sb-int:unix-namestring new-name nil)) + (setf (sm filename stream) (file-namestring new-name)) t) nil)) @@ -293,12 +293,11 @@ (funcall-stm-handler j-listen (sm melded-stream stream)) (or (< (sm buffpos stream) (sm buffer-ptr stream)) ;; Attempt buffer refill - (let ((lcrs (sm last-char-read-size stream))) - (when (and (not (any-stream-instance-flags stream :dual :string)) - (>= (sm mode stream) 0)) - ;; single-channel stream dirty -> write data before reading - (flush-buffer stream nil)) - (>= (refill-buffer stream nil) width)))))) + (when (and (not (any-stream-instance-flags stream :dual :string)) + (>= (sm mode stream) 0)) + ;; single-channel stream dirty -> write data before reading + (flush-buffer stream nil)) + (>= (refill-buffer stream nil) width))))) (defun %clear-input (stream buffer-only) (declare (type simple-stream stream)) @@ -585,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) (*)) @@ -750,7 +751,6 @@ (defun read-char-no-hang (&optional (stream *standard-input*) (eof-error-p t) eof-value recursive-p) "Returns the next character from the Stream if one is availible, or nil." - (declare (ignore recursive-p)) (let ((stream (sb-impl::in-synonym-of stream))) (etypecase stream (simple-stream @@ -1099,7 +1099,7 @@ is supported only on simple-streams." (cond (new-name (setf (sb-impl::fd-stream-pathname stream) new-name) (setf (sb-impl::fd-stream-file stream) - (sb-int:unix-namestring new-name nil)) + (file-namestring new-name)) t) (t (sb-impl::fd-stream-pathname stream))))))