aboutsummaryrefslogtreecommitdiff
path: root/email
diff options
context:
space:
mode:
authorArun Isaac2019-07-28 12:11:53 +0530
committerArun Isaac2019-07-28 12:13:44 +0530
commit1f7c45fa0b71bd137e4b661e0d473c3eb9c98f48 (patch)
tree9aebddcb45cbaf7b6e47fc961c98639fd9e0fe42 /email
parent97d4fb537a6ca5a2ffe4da18bd1cbde2d4084fd0 (diff)
downloadguile-email-1f7c45fa0b71bd137e4b661e0d473c3eb9c98f48.tar.gz
guile-email-1f7c45fa0b71bd137e4b661e0d473c3eb9c98f48.tar.lz
guile-email-1f7c45fa0b71bd137e4b661e0d473c3eb9c98f48.zip
email: Read mboxes as bytevectors.
* email/email.scm (read-next-email-in-mbox): Read bytes from mboxes, not characters.
Diffstat (limited to 'email')
-rw-r--r--email/email.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/email/email.scm b/email/email.scm
index 565f8e7..7dc882c 100644
--- a/email/email.scm
+++ b/email/email.scm
@@ -894,8 +894,10 @@ list of header keys and values."
;; Read and discard From_ line
(get-line-with-delimiter port)
;; Read the actual email
- (read-while port get-line-with-delimiter
- (negate (cut string-prefix? "From " <>))))
+ (let ((email (read-bytes-till
+ port (string->bytevector "\nFrom " "us-ascii"))))
+ (read-char port)
+ email))
(define (mbox->emails port)
(read-objects read-next-email-in-mbox port))