From da2e2f4be772532cacd9188d206d4eb82dc9f6ef Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 18 Jul 2003 17:01:33 +0000 Subject: [PATCH] 0.8.1.46: Merge patch from David Lichteblau (sbcl-devel 2003-06-01) for (signed-byte 8) streams. ... no real insight, so merge it and hope for the best --- NEWS | 4 ++++ src/code/fd-stream.lisp | 8 +++++++- tests/stream.impure.lisp | 11 +++++++++++ version.lisp-expr | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 337069c..47b6ad0 100644 --- a/NEWS +++ b/NEWS @@ -1924,6 +1924,10 @@ changes in sbcl-0.8.2 relative to sbcl-0.8.1: provide helpful disassembly notes. * SB-MOP:CLASS-PROTOTYPE on built-in-classes returns an instance of the class in more cases than previously. + * bug fix: FILE-POSITION now understands :START and :END for + STRING-INPUT-STREAMs. (thanks to Nikodemus Siivola) + * bug fix: (SIGNED-BYTE 8) streams no longer return (UNSIGNED-BYTE + 8) data. (thanks to David Lichteblau) * fixed some bugs revealed by Paul Dietz' test suite: ** LAST and [N]BUTLAST should accept a bignum. ** condition slot accessors are methods. diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index 91b8f86..309febd 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -682,7 +682,13 @@ (fd-stream-bin fd-stream) routine)) (when (eql size 1) (setf (fd-stream-n-bin fd-stream) #'fd-stream-read-n-bytes) - (when buffer-p + (when (and buffer-p + ;; We only create this buffer for streams of type + ;; (unsigned-byte 8). Because there's no buffer, the + ;; other element-types will dispatch to the appropriate + ;; input (output) routine in fast-read-byte. + (or (eq type 'unsigned-byte) + (eq type :default))) (setf (ansi-stream-in-buffer fd-stream) (make-array +ansi-stream-in-buffer-length+ :element-type '(unsigned-byte 8))))) diff --git a/tests/stream.impure.lisp b/tests/stream.impure.lisp index d2891f4..d3f3adf 100644 --- a/tests/stream.impure.lisp +++ b/tests/stream.impure.lisp @@ -55,5 +55,16 @@ '(sb-impl::string-output-stream string-stream stream))) +;;; improper buffering on (SIGNED-BYTE 8) streams (fixed by David Lichteblau): +(let ((p "signed-byte-8-test.data")) + (with-open-file (s p + :direction :output + :element-type '(unsigned-byte 8) + :if-exists :supersede) + (write-byte 255 s)) + (with-open-file (s p :element-type '(signed-byte 8)) + (assert (= (read-byte s) -1))) + (delete-file p)) + ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 40c8a8b..ecf4f07 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.1.45" +"0.8.1.46" -- 1.7.10.4