mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
Always return a simple-string from OCTETS-TO-STRING
UCS and UTF external formats were returning the adjustable array directly, which wasn't necessarily a disaster in itself but was also not conforming with the type declaration of OCTETS-TO-STRING, so could have led to problems in downstream code.
This commit is contained in:
parent
04c7b03380
commit
6bb16a7dbc
3
NEWS
3
NEWS
|
|
@ -40,6 +40,9 @@ changes in the external-format-line-endings branch:
|
|||
* bug fix: converting from octets using the UCS-2, UCS-4 and UTF-32 external
|
||||
formats no longer reads past the end of an octet array with a non-integral
|
||||
number of two- or four-byte units.
|
||||
* bug fix: converting from octets using the UCS-2, UCS-4, UTF-16 or UTF-32
|
||||
external formats now returns a simple string, as required by the type
|
||||
declaration of OCTETS-TO-STRING.
|
||||
* bug fix: providing an invalid external format argument to OPEN or
|
||||
WITH-OPEN-FILE (or the internal MAKE-FD-STREAM) no longer leaks a file
|
||||
descriptor.
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@
|
|||
(dotimes (i (length instead))
|
||||
(vector-push-extend (char instead i) string))))
|
||||
(incf pos bytes)))
|
||||
string))
|
||||
(copy-seq string)))
|
||||
(defun ,name-be (array astart aend replacement)
|
||||
(declare (optimize speed #.*safety-0*)
|
||||
(type ,type array)
|
||||
|
|
@ -243,7 +243,7 @@
|
|||
(dotimes (i (length instead))
|
||||
(vector-push-extend (char instead i) string))))
|
||||
(incf pos bytes)))
|
||||
string)))))
|
||||
(copy-seq string))))))
|
||||
|
||||
(instantiate-octets-definition define-ucs-2->string)
|
||||
|
||||
|
|
@ -416,7 +416,7 @@
|
|||
(string (dotimes (i (length thing))
|
||||
(vector-push-extend (char thing i) string)))))
|
||||
(incf pos bytes)))
|
||||
string))
|
||||
(copy-seq string)))
|
||||
(defun ,name-be (array astart aend replacement)
|
||||
(declare (optimize speed #.*safety-0*)
|
||||
(type ,type array)
|
||||
|
|
@ -438,7 +438,7 @@
|
|||
(string (dotimes (i (length thing))
|
||||
(vector-push-extend (char thing i) string)))))
|
||||
(incf pos bytes)))
|
||||
string)))))
|
||||
(copy-seq string))))))
|
||||
|
||||
(instantiate-octets-definition define-ucs-4->string)
|
||||
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@
|
|||
(t (dotimes (i (length invalid))
|
||||
(vector-push-extend (char invalid i) string))))
|
||||
(incf pos bytes)))
|
||||
string))
|
||||
(copy-seq string)))
|
||||
(defun ,name-be (array astart aend replacement)
|
||||
(declare (optimize speed #.*safety-0*)
|
||||
(type ,type array)
|
||||
|
|
@ -251,7 +251,7 @@
|
|||
(t (dotimes (i (length invalid))
|
||||
(vector-push-extend (char invalid i) string))))
|
||||
(incf pos bytes)))
|
||||
string)))))
|
||||
(copy-seq string))))))
|
||||
|
||||
(instantiate-octets-definition define-utf-16->string)
|
||||
|
||||
|
|
@ -479,7 +479,7 @@
|
|||
(string (dotimes (i (length thing))
|
||||
(vector-push-extend (char thing i) string)))))
|
||||
(incf pos bytes)))
|
||||
string))
|
||||
(copy-seq string)))
|
||||
(defun ,name-be (array astart aend replacement)
|
||||
(declare (optimize speed #.*safety-0*)
|
||||
(type ,type array)
|
||||
|
|
@ -501,7 +501,7 @@
|
|||
(string (dotimes (i (length thing))
|
||||
(vector-push-extend (char thing i) string)))))
|
||||
(incf pos bytes)))
|
||||
string)))))
|
||||
(copy-seq string))))))
|
||||
|
||||
(instantiate-octets-definition define-utf-32->string)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue