Fix two bugs

- return 2 values instead of pair from READ-RFC822-FIELD
- return alist in correct order from READ-RFC822-HEADERS and
  READ-RFC822-HEADERS-WITH-LINE-BREAKS
This commit is contained in:
sperber 2003-01-20 16:32:13 +00:00
parent 8b2217907e
commit 3611d6486d
1 changed files with 5 additions and 4 deletions

View File

@ -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))