CMUCL commit: RELEASE-20B-BRANCH src/code (stream.lisp)

Raymond Toy rtoy at common-lisp.net
Fri Sep 3 04:18:53 CEST 2010


    Date: Thursday, September 2, 2010 @ 22:18:53
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/code
     Tag: RELEASE-20B-BRANCH

Modified: stream.lisp

fix some bugs in previous commit.

o For debugging, the last sbuf element is
  lisp-stream-string-buffer-len, not one more than that.
o We were not copying the last element of the string-buffer to the
  beginning. 
o Forgot to set the stream in-length correctly when we had to retry
  reading octets to get a whole character. 


-------------+
 stream.lisp |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)


Index: src/code/stream.lisp
diff -u src/code/stream.lisp:1.94.4.3 src/code/stream.lisp:1.94.4.4
--- src/code/stream.lisp:1.94.4.3	Thu Sep  2 19:47:31 2010
+++ src/code/stream.lisp	Thu Sep  2 22:18:53 2010
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /project/cmucl/cvsroot/src/code/stream.lisp,v 1.94.4.3 2010-09-02 23:47:31 rtoy Exp $")
+  "$Header: /project/cmucl/cvsroot/src/code/stream.lisp,v 1.94.4.4 2010-09-03 02:18:53 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -738,7 +738,7 @@
       (format t "in-length = ~A~%" in-length)
       (format t "ibuf before = ~A~%" ibuf)
       (format t "sbuf before = ~S~%" (subseq (lisp-stream-string-buffer stream) 0
-					     (1+ (lisp-stream-string-buffer-len stream)))))
+					     (lisp-stream-string-buffer-len stream))))
 
     ;; Copy the stuff we haven't read from in-buffer to the beginning
     ;; of the buffer.
@@ -798,7 +798,7 @@
 	       #+(or debug-frc-sr)
 	       (format t "slen = ~A~%" slen)
 	       (when (plusp slen)
-		 (setf (schar sbuf 0) (schar sbuf slen)))
+		 (setf (schar sbuf 0) (schar sbuf (1- slen))))
 	       #+(or debug-frc-sr)
 	       (progn
 		 (format t "sbuf[0] = ~S~%" (schar sbuf 0))
@@ -852,6 +852,7 @@
 				      (lisp-stream-string-buffer-len stream))
 				(funcall (lisp-stream-in stream) stream eof-errorp eof-value))
 			       (t
+				(setf (fd-stream-in-length stream) (+ count index))
 				(convert-buffer)))))))))))))
 
 ;;; FAST-READ-BYTE-REFILL  --  Interface



More information about the cmucl-commit mailing list