diff options
| author | Chong Yidong | 2008-09-24 17:56:13 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-09-24 17:56:13 +0000 |
| commit | c8145d5e956da6d50864e836d8179cb4fe792bf6 (patch) | |
| tree | 88f9b45f6d46c6853fc80c079da7cdbd96a1223d | |
| parent | 574297e3b9c978a845e92daade9671c7787c96f1 (diff) | |
| download | emacs-c8145d5e956da6d50864e836d8179cb4fe792bf6.tar.gz emacs-c8145d5e956da6d50864e836d8179cb4fe792bf6.zip | |
(rfc822-addresses): Prevent rfc822-bad-address from raising a
wrong-type-argument error.
| -rw-r--r-- | lisp/mail/rfc822.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el index 9a15072be6b..4e002296b1f 100644 --- a/lisp/mail/rfc822.el +++ b/lisp/mail/rfc822.el | |||
| @@ -292,12 +292,15 @@ | |||
| 292 | (goto-char (point-min)) | 292 | (goto-char (point-min)) |
| 293 | (let ((list ()) | 293 | (let ((list ()) |
| 294 | tem | 294 | tem |
| 295 | rfc822-address-start); this is for rfc822-bad-address | 295 | ;; This is for rfc822-bad-address. Give it a non-nil |
| 296 | (rfc822-nuke-whitespace) | 296 | ;; initial value to prevent rfc822-bad-address from |
| 297 | (while (not (eobp)) | 297 | ;; raising a wrong-type-argument error |
| 298 | (setq rfc822-address-start (point)) | 298 | (rfc822-address-start (point))) |
| 299 | (setq tem | 299 | (catch 'address ; this is for rfc822-bad-address |
| 300 | (catch 'address ; this is for rfc822-bad-address | 300 | (rfc822-nuke-whitespace) |
| 301 | (while (not (eobp)) | ||
| 302 | (setq rfc822-address-start (point)) | ||
| 303 | (setq tem | ||
| 301 | (cond ((rfc822-looking-at ?\,) | 304 | (cond ((rfc822-looking-at ?\,) |
| 302 | nil) | 305 | nil) |
| 303 | ((looking-at "[][\000-\037@;:\\.>)]") | 306 | ((looking-at "[][\000-\037@;:\\.>)]") |
| @@ -306,14 +309,14 @@ | |||
| 306 | (format "Strange character \\%c found" | 309 | (format "Strange character \\%c found" |
| 307 | (preceding-char)))) | 310 | (preceding-char)))) |
| 308 | (t | 311 | (t |
| 309 | (rfc822-addresses-1 t))))) | 312 | (rfc822-addresses-1 t)))) |
| 310 | (cond ((null tem)) | 313 | (cond ((null tem)) |
| 311 | ((stringp tem) | 314 | ((stringp tem) |
| 312 | (setq list (cons tem list))) | 315 | (setq list (cons tem list))) |
| 313 | (t | 316 | (t |
| 314 | (setq list (nconc (nreverse tem) list))))) | 317 | (setq list (nconc (nreverse tem) list))))) |
| 315 | (nreverse list))) | 318 | (nreverse list)))) |
| 316 | (and buf (kill-buffer buf)))))) | 319 | (and buf (kill-buffer buf)))))) |
| 317 | 320 | ||
| 318 | (provide 'rfc822) | 321 | (provide 'rfc822) |
| 319 | 322 | ||