summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-01-19 00:40:42 -0500
committerKyle Meyer <kyle@kyleam.com>2021-01-19 18:09:58 -0500
commita8d858b6658fc4f0b9fe71073c958b342425f7a0 (patch)
tree6bd2b74018bd3a7aaa801ce3065676e8ff52f16b
parent9abfc09d24e73044f2392f45fc41169ee4afd72f (diff)
downloadpiem-a8d858b6658fc4f0b9fe71073c958b342425f7a0.tar.gz
inject: Anchor 'From mboxrd@z ...' search
piem--write-mbox-to-maildir finds the bounds for each message by doing a plain search for "From mboxrd@z", but of course nothing prevents that from being within the text of the message. Anchor it to the start of the line to prevent false positives. Message-Id: <20210119054042.11985-1-kyle@kyleam.com>
-rw-r--r--piem.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/piem.el b/piem.el
index 8c23e7b..867a7e5 100644
--- a/piem.el
+++ b/piem.el
@@ -489,9 +489,9 @@ A buffer with the decompressed content is returned."
(let ((n-added 0)
(n-skipped 0))
(while (and (not (eobp))
- (search-forward "From mboxrd@z" nil t))
+ (re-search-forward "^From mboxrd@z" nil t))
(let* ((beg (line-beginning-position 2))
- (end (or (and (search-forward "From mboxrd@z" nil t)
+ (end (or (and (re-search-forward "^From mboxrd@z" nil t)
(progn (goto-char (line-beginning-position 0))
(point-marker)))
(point-max-marker)))