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

Helmut Eller heller at common-lisp.net
Sun Sep 19 06:11:15 UTC 2004


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

Modified Files:
	swank-gray.lisp 
Log Message:
(stream-read-char): Treat empty strings as end-of-file.
Date: Sun Sep 19 08:11:14 2004
Author: heller

Index: slime/swank-gray.lisp
diff -u slime/swank-gray.lisp:1.5 slime/swank-gray.lisp:1.6
--- slime/swank-gray.lisp:1.5	Tue Mar  9 20:35:36 2004
+++ slime/swank-gray.lisp	Sun Sep 19 08:11:14 2004
@@ -2,7 +2,7 @@
 ;;;
 ;;; swank-gray.lisp --- Gray stream based IO redirection.
 ;;;
-;;; Created 2003, Helmut Eller
+;;; Created 2003
 ;;;
 ;;; This code has been placed in the Public Domain.  All warranties
 ;;; are disclaimed.
@@ -51,8 +51,12 @@
     (when (= index (length buffer))
       (when output-stream
         (force-output output-stream))
-      (setf buffer (funcall input-fn))
-      (setf index 0))
+      (let ((string (funcall input-fn)))
+        (cond ((zerop (length string))
+               (return-from stream-read-char :eof))
+              (t
+               (setf buffer string)
+               (setf index 0)))))
     (assert (plusp (length buffer)))
     (prog1 (aref buffer index) (incf index))))
 





More information about the slime-cvs mailing list