diff --git a/scheme/lib/ftp.scm b/scheme/lib/ftp.scm index 19956a0..d7604cd 100644 --- a/scheme/lib/ftp.scm +++ b/scheme/lib/ftp.scm @@ -434,18 +434,18 @@ (let-optionals* maybe-expected ((expected "2..")) (let* ((sock (ftp-connection-command-socket connection)) (IN (socket:inport sock)) - (response (read-line IN))) + (response (read-crlf-line IN))) (ftp-log connection (format #f "-> ~a" response)) (or (string-match expected response) (signal 'ftp-error response)) ;; handle multi-line responses (if (equal? (string-ref response 3) #\-) (let loop ((code (string-append (substring response 0 3) " ")) - (line (read-line IN))) + (line (read-crlf-line IN))) (ftp-log connection (format #f "-> ~a" line)) (set! response (string-join (list response line "\n"))) (or (string-match code line) - (loop code (read-line IN))))) + (loop code (read-crlf-line IN))))) response)))