From aefa144421613a0f9d823e8568b68df130435a3b Mon Sep 17 00:00:00 2001 From: joost Date: Wed, 5 Jun 2013 10:19:08 +0200 Subject: [PATCH] handle the case where phrase is empty --- mu4e/mu4e-utils.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index 0eaab14e..d888d32a 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -553,13 +553,14 @@ process." (defun mu4e~rfc822-phrase-type (ph) "Return either atom, quoted-string, a corner-case or nil. This - checks for quotes around the phrase first + checks for empty string first. Then quotes around the phrase (returning 'rfc822-quoted-string). Then whether there is a quote inside the phrase (returning 'rfc822-containing-quote). The reverse of the RFC atext definition is then tested. If it matches, nil is returned, if not, it is an 'rfc822-atom, which is returned." (cond + ((= (length ph) 0) 'rfc822-empty) ((= (aref ph 0) ?\") (if (string-match "\"\\([^\"\\\n]\\|\\\\.\\|\\\\\n\\)*\"" ph) 'rfc822-quoted-string