In copy-ascii-port->port, get length of line only after checking for EOF.
This commit is contained in:
@@ -37,10 +37,9 @@
|
||||
(define (copy-ascii-port->port input-port output-port)
|
||||
(let loop ()
|
||||
(let* ((line (read-crlf-line input-port
|
||||
#f))
|
||||
(length (string-length line)))
|
||||
#f)))
|
||||
(if (not (eof-object? line))
|
||||
(begin
|
||||
(let ((length (string-length line)))
|
||||
(write-string line output-port 0 length)
|
||||
(newline output-port)
|
||||
(loop)))))
|
||||
|
||||
Reference in New Issue
Block a user