Fix bug: get-output-bytevector must flush the buffer.
authorChris Hanson <org/chris-hanson/cph>
Fri, 13 Jan 2017 08:50:19 +0000 (00:50 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 13 Jan 2017 08:50:19 +0000 (00:50 -0800)
Actually this is kind of a bug: output to bytevectors shouldn't be buffered at
all.

src/runtime/binary-port.scm

index f422e9304fb0de9277af903603ce5ca1b1445ee1..01836ffe719eab25bb87a73ded1a320d97e23301 100644 (file)
@@ -160,6 +160,7 @@ USA.
 
 (define (get-output-bytevector port)
   (guarantee bytevector-output-port? port 'get-output-bytevector)
+  (flush-binary-output-port port)
   ((output-sink-custom-ref (buffer-source/sink (port-output-buffer port)) 1)))
 
 (define (bytevector-output-port? object)