1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

Make address parsing more robust

* lisp/mail/ietf-drums.el (ietf-drums-parse-address): Don't
bug out on addresses like
(ietf-drums-parse-address "\"Foo \"bar\" <larsi@gnus.org>")
(bug#18572).
This commit is contained in:
Lars Ingebrigtsen 2017-01-25 21:21:40 +01:00
parent e0e95199b9
commit 27accec970

View File

@ -192,6 +192,17 @@ the Content-Transfer-Encoding header of a mail."
(ietf-drums-init string)
(while (not (eobp))
(setq c (char-after))
;; If we have an uneven number of quote characters,
;; `forward-sexp' will fail. In these cases, just delete the
;; final of these quote characters.
(when (and (eq c ?\")
(not
(save-excursion
(ignore-errors
(forward-sexp 1)
t))))
(delete-char 1)
(setq c (char-after)))
(cond
((or (eq c ? )
(eq c ?\t))