diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2017-01-25 21:21:40 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2017-01-25 21:21:40 +0100 |
commit | 27accec97022a49b362feeb36293fdce2947eb43 (patch) | |
tree | 63eb43b64cfe7c3d30d062cb29561d1c37391b77 | |
parent | e0e95199b93a232e5d4da67823364676ca9cb67c (diff) | |
download | emacs-27accec97022a49b362feeb36293fdce2947eb43.tar.gz |
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).
-rw-r--r-- | lisp/mail/ietf-drums.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el index a3e53cfe793..fd793a28309 100644 --- a/lisp/mail/ietf-drums.el +++ b/lisp/mail/ietf-drums.el @@ -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)) |