From cc532ea98d13393734730bc0971d50dad4a500fe Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 1 May 2005 04:08:07 +0000 Subject: [PATCH] . original commit: 7ed45e1d4087850f5d14caf8ae2cf7fa74b18ec1 --- collects/mzlib/port.ss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/mzlib/port.ss b/collects/mzlib/port.ss index 3ec1c34..aef398c 100644 --- a/collects/mzlib/port.ss +++ b/collects/mzlib/port.ss @@ -1276,7 +1276,11 @@ ;; -------------------------------------------------- (define reencode-output-port - (opt-lambda (port encoding [error-bytes #f] [close? #f] [name (object-name port)] [buffer-mode 'block]) + (opt-lambda (port encoding [error-bytes #f] [close? #f] [name (object-name port)] + [buffer-mode (if (and (output-port? port) + (file-stream-port? port)) + (file-stream-buffer-mode port) + 'block)]) (let ([c (bytes-open-converter "UTF-8" encoding)] [ready-bytes (make-bytes 1024)] [ready-start 0]