diff --git a/scheme/lib/rfc822.scm b/scheme/lib/rfc822.scm index 90cfb41..913d83b 100644 --- a/scheme/lib/rfc822.scm +++ b/scheme/lib/rfc822.scm @@ -64,9 +64,10 @@ (lambda (s) (string->symbol (string-map char-upcase s))))) (define (read-rfc822-field . args) - (let ((pair (apply read-rfc822-field-with-line-breaks args))) - (cons (car pair) - (string-concatenate (cdr pair))))) + (receive (field body) + (apply read-rfc822-field-with-line-breaks args) + (values field + (string-concatenate body)))) (define (read-rfc822-field-with-line-breaks . args) (let-optionals args ((port (current-input-port)) @@ -100,7 +101,7 @@ (read-rfc822-field port read-line) (if field (lp (cons (cons field val) alist)) - alist)))))) + (reverse alist))))))) (define read-rfc822-headers (make-read-rfc822-headers read-rfc822-field))