[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 27accec 1/2: Make address parsing more robust
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 27accec 1/2: Make address parsing more robust |
Date: |
Wed, 25 Jan 2017 20:48:20 +0000 (UTC) |
branch: master
commit 27accec97022a49b362feeb36293fdce2947eb43
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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\" <address@hidden>")
(bug#18572).
---
lisp/mail/ietf-drums.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lisp/mail/ietf-drums.el b/lisp/mail/ietf-drums.el
index a3e53cf..fd793a2 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))