]> git.eshelyaron.com Git - emacs.git/commitdiff
(rfc822-addresses): Prevent rfc822-bad-address from raising a
authorChong Yidong <cyd@stupidchicken.com>
Wed, 24 Sep 2008 17:56:13 +0000 (17:56 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 24 Sep 2008 17:56:13 +0000 (17:56 +0000)
wrong-type-argument error.

lisp/mail/rfc822.el

index 9a15072be6ba125538e07dd426d8a153cc2c7bd3..4e002296b1f76cd73d656b83154950bb8d7eb8d5 100644 (file)
          (goto-char (point-min))
          (let ((list ())
                tem
-               rfc822-address-start); this is for rfc822-bad-address
-           (rfc822-nuke-whitespace)
-           (while (not (eobp))
-             (setq rfc822-address-start (point))
-             (setq tem
-                   (catch 'address ; this is for rfc822-bad-address
+               ;; This is for rfc822-bad-address.  Give it a non-nil
+               ;; initial value to prevent rfc822-bad-address from
+               ;; raising a wrong-type-argument error
+               (rfc822-address-start (point)))
+           (catch 'address ; this is for rfc822-bad-address
+             (rfc822-nuke-whitespace)
+             (while (not (eobp))
+               (setq rfc822-address-start (point))
+               (setq tem
                      (cond ((rfc822-looking-at ?\,)
                             nil)
                            ((looking-at "[][\000-\037@;:\\.>)]")
                               (format "Strange character \\%c found"
                                       (preceding-char))))
                            (t
-                            (rfc822-addresses-1 t)))))
-             (cond ((null tem))
-                   ((stringp tem)
-                    (setq list (cons tem list)))
-                   (t
-                    (setq list (nconc (nreverse tem) list)))))
-           (nreverse list)))
-      (and buf (kill-buffer buf))))))
+                            (rfc822-addresses-1 t))))
+               (cond ((null tem))
+                     ((stringp tem)
+                      (setq list (cons tem list)))
+                     (t
+                      (setq list (nconc (nreverse tem) list)))))
+             (nreverse list))))
+       (and buf (kill-buffer buf))))))
 
 (provide 'rfc822)