aboutsummaryrefslogtreecommitdiff
path: root/email
diff options
context:
space:
mode:
Diffstat (limited to 'email')
-rw-r--r--email/quoted-printable.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/email/quoted-printable.scm b/email/quoted-printable.scm
index f6e3605..317bf81 100644
--- a/email/quoted-printable.scm
+++ b/email/quoted-printable.scm
@@ -31,13 +31,14 @@
(((? port? in))
(let-values (((out get-bytevector)
(open-bytevector-output-port)))
- (quoted-printable-decode in out)
- (get-bytevector)))
+ (call-with-port
+ out (lambda (out)
+ (quoted-printable-decode in out)
+ (get-bytevector)))))
(((? port? in) (? port? out))
(let ((c (read-char in)))
(cond
- ((eof-object? c)
- out)
+ ((eof-object? c) out)
((char=? c #\=)
;; TODO: Support "\r\n" line ending
(let ((c1 (read-char in)))
@@ -45,9 +46,9 @@
(let ((c2 (read-char in)))
(put-u8 out (string->number (string c1 c2) 16)))))
(quoted-printable-decode in out))
- (#t
- (put-u8 out (char->integer c))
- (quoted-printable-decode in out)))))))
+ (else (put-u8 out (char->integer c))
+ (quoted-printable-decode in out)))))))
+
(define (q-encoding-decode str)
(quoted-printable-decode