mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
1.0.35.8: Fix FILE-POSITION on simple-streams after READ-VECTOR
Patch ported from CMUCL; independent testcase that doesn't rely on Unixisms added instead of the one from CMUCL.
This commit is contained in:
parent
d61819dea7
commit
d9dc64d61b
2
NEWS
2
NEWS
|
|
@ -1,5 +1,7 @@
|
|||
;;;; -*- coding: utf-8; fill-column: 78 -*-
|
||||
changes relative to sbcl-1.0.35:
|
||||
* bug fix: Fix SB-SIMPLE-STREAMS:READ-VECTOR to correctly set the
|
||||
FILE-POSITION of the stream being read from. (launchpad bug lp#491087)
|
||||
* bug fix: Fix grammer and style issues for the docstrings of
|
||||
printer-related variables and functions. (Thanks to mon_key; launchpad
|
||||
bug lp#518696)
|
||||
|
|
|
|||
|
|
@ -584,10 +584,12 @@
|
|||
(index (or start 0) (1+ index))
|
||||
(end (or end (* (length vector) (vector-elt-width vector))))
|
||||
(endian-swap (endian-swap-value vector endian-swap))
|
||||
(byte (read-byte-internal encap nil nil t)
|
||||
(read-byte-internal encap nil nil nil)))
|
||||
((or (null byte) (>= index end)) index)
|
||||
(setf (bref vector (logxor index endian-swap)) byte))))))
|
||||
(flag t nil))
|
||||
((>= index end) index)
|
||||
(let ((byte (read-byte-internal encap nil nil flag)))
|
||||
(unless byte
|
||||
(return index))
|
||||
(setf (bref vector (logxor index endian-swap)) byte)))))))
|
||||
((or ansi-stream fundamental-stream)
|
||||
(unless (typep vector '(or string
|
||||
(simple-array (signed-byte 8) (*))
|
||||
|
|
|
|||
1
contrib/sb-simple-streams/lp491087.txt
Normal file
1
contrib/sb-simple-streams/lp491087.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
0123
|
||||
|
|
@ -930,3 +930,22 @@ Nothing to see here, move along.")
|
|||
:external-format :utf-8)
|
||||
(char-code (read-char s))))
|
||||
196)
|
||||
|
||||
;; launchpad bug #491087
|
||||
|
||||
(deftest lp491087
|
||||
(labels ((read-big-int (stream)
|
||||
(let ((b (make-array 1 :element-type '(signed-byte 32)
|
||||
:initial-element 0)))
|
||||
(declare (dynamic-extent b))
|
||||
(sb-simple-streams::read-vector b stream
|
||||
:endian-swap :network-order)
|
||||
(aref b 0))))
|
||||
(with-open-file (stream "lp491087.txt" :class 'file-simple-stream)
|
||||
(let* ((start (file-position stream))
|
||||
(integer (read-big-int stream))
|
||||
(end (file-position stream)))
|
||||
(and (= start 0)
|
||||
(= integer #x30313233)
|
||||
(= end 4)))))
|
||||
T)
|
||||
|
|
|
|||
|
|
@ -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".)
|
||||
"1.0.35.7"
|
||||
"1.0.35.8"
|
||||
|
|
|
|||
Loading…
Reference in a new issue