[slime-cvs] CVS update: slime/swank-cmucl.lisp

Helmut Eller heller at common-lisp.net
Mon Mar 8 23:45:19 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv12032

Modified Files:
	swank-cmucl.lisp 
Log Message:
(read-into-simple-string): Use the correct fix.  Reported by Håkon
Alstadheim.

Date: Mon Mar  8 18:45:19 2004
Author: heller

Index: slime/swank-cmucl.lisp
diff -u slime/swank-cmucl.lisp:1.78 slime/swank-cmucl.lisp:1.79
--- slime/swank-cmucl.lisp:1.78	Sun Mar  7 11:41:11 2004
+++ slime/swank-cmucl.lisp	Mon Mar  8 18:45:19 2004
@@ -24,10 +24,17 @@
              :format-control "Trying to read characters from a binary stream."))
     ;; Let's go as low level as it seems reasonable.
     (let* ((numbytes (- end start))
-           (bytes-read (system:read-n-bytes stream s start numbytes t)))
-      (if (< bytes-read numbytes)
-          (+ start bytes-read)
-          end)))
+           (total-bytes 0))
+      ;; read-n-bytes may return fewer bytes than requested, so we need
+      ;; to keep trying.
+      (loop while (plusp numbytes) do
+            (let ((bytes-read (system:read-n-bytes stream s start numbytes nil)))
+              (when (zerop bytes-read)
+                (return-from read-into-simple-string total-bytes))
+              (incf total-bytes bytes-read)
+              (incf start bytes-read)
+              (decf numbytes bytes-read)))
+      total-bytes))
 
   (let ((s (find-symbol (string :*enable-package-locked-errors*) :lisp)))
     (when s





More information about the slime-cvs mailing list