Skip to content
Snippets Groups Projects
Commit 9c97e6f6 authored by Tim Bradshaw's avatar Tim Bradshaw
Browse files

read-stream-content-into-string element-type fix

Default the element type of the string being created from the element
type of the stream being read.

This has two advantages: it will make things work for implementations
which have a mode where the default string element type is a subtype
of character, and it will also mean that if the stream's element type
is a subtype of character you may get thinner strings.
parent 49e82add
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,8 @@ which is only sent to WITH-OPEN-FILE when it's not NIL."
"Return the \"content\" of STREAM as a fresh string."
(check-type buffer-size positive-integer)
(let ((*print-pretty* nil))
(with-output-to-string (datum)
(with-output-to-string (datum nil
:element-type (stream-element-type stream))
(let ((buffer (make-array buffer-size :element-type 'character)))
(loop
:for bytes-read = (read-sequence buffer stream)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment