/[cmucl]/src/code/stream.lisp
ViewVC logotype

Diff of /src/code/stream.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.64 by toy, Wed Jul 30 16:51:43 2003 UTC revision 1.65 by toy, Fri Oct 24 16:53:42 2003 UTC
# Line 2104  POSITION: an INTEGER greater than or equ Line 2104  POSITION: an INTEGER greater than or equ
2104             :format-control "Trying to read characters from a binary stream."))             :format-control "Trying to read characters from a binary stream."))
2105    ;; Let's go as low level as it seems reasonable.    ;; Let's go as low level as it seems reasonable.
2106    (let* ((numbytes (- end start))    (let* ((numbytes (- end start))
2107           (bytes-read (system:read-n-bytes stream s start numbytes nil))           (total-bytes 0))
2108           )      ;; read-n-bytes may return fewer bytes than requested, so we need
2109      (if (< bytes-read numbytes)      ;; to keep trying.
2110          (+ start bytes-read)      (loop while (plusp numbytes) do
2111          end)))            (let ((bytes-read (system:read-n-bytes stream s start numbytes nil)))
2112                (when (zerop bytes-read)
2113                  (return-from read-into-simple-string total-bytes))
2114                (incf total-bytes bytes-read)
2115                (incf start bytes-read)
2116                (decf numbytes bytes-read)))
2117        total-bytes))
2118    
2119    
2120  (defun read-into-string (s stream start end)  (defun read-into-string (s stream start end)

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

  ViewVC Help
Powered by ViewVC 1.1.5