In copy-ascii-port->port, get length of line only after checking for EOF.

This commit is contained in:
mainzelm 2004-02-17 16:07:22 +00:00
parent 73f55ffb1b
commit f328c0537f
1 changed files with 2 additions and 3 deletions

View File

@ -37,10 +37,9 @@
(define (copy-ascii-port->port input-port output-port) (define (copy-ascii-port->port input-port output-port)
(let loop () (let loop ()
(let* ((line (read-crlf-line input-port (let* ((line (read-crlf-line input-port
#f)) #f)))
(length (string-length line)))
(if (not (eof-object? line)) (if (not (eof-object? line))
(begin (let ((length (string-length line)))
(write-string line output-port 0 length) (write-string line output-port 0 length)
(newline output-port) (newline output-port)
(loop))))) (loop)))))