summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-11 16:45:12 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-11 16:45:16 +0200
commitd608eb1c941aac65d0a1d02b0ac6279e42d8ca8b (patch)
treed11c21a644a9778473fafc1eb8931004b3e948d9
parentb054393dd1b9146522d8aeb21cb9b1ad52210a33 (diff)
downloademacs-d608eb1c941aac65d0a1d02b0ac6279e42d8ca8b.tar.gz
Guard against faulty flow-filled emails
* lisp/mail/flow-fill.el (fill-flowed): Don't bug out if there's a space at the end of the buffer. This is probably not allowed in the flow-fill specification, but has been observed in the wild.
-rw-r--r--lisp/mail/flow-fill.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el
index f4b55031194..b357b3e2563 100644
--- a/lisp/mail/flow-fill.el
+++ b/lisp/mail/flow-fill.el
@@ -157,7 +157,8 @@ lines."
;; Hack: Don't do the flowing on the signature line.
(when (and (not (looking-at "-- $"))
(eq (char-before (line-end-position)) ?\s))
- (while (eq (char-before (line-end-position)) ?\s)
+ (while (and (not (eobp))
+ (eq (char-before (line-end-position)) ?\s))
(end-of-line)
(when delete-space
(delete-char -1))