From 416e4f4cd800613ecdf9f62f4fb3670585dbf296 Mon Sep 17 00:00:00 2001 From: yoichi Date: Sat, 3 Jan 2004 00:14:15 +0000 Subject: [PATCH] * wl-address.el (wl-address-add-or-change): Don't add empty address. --- wl/ChangeLog | 2 ++ wl/wl-address.el | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 9573ae1..b2a62a9 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,6 +1,8 @@ 2004-01-03 Yoichi NAKAYAMA * wl-address.el (wl-address-delete): Avoid mis-deleting. + * wl-address.el (wl-address-add-or-change): Don't add empty + address. 2004-01-01 TAKAHASHI Kaoru diff --git a/wl/wl-address.el b/wl/wl-address.el index f204a44..f158400 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -671,9 +671,16 @@ If already registerd, change it." the-realname))) (when change-address (setq new-addr (read-from-minibuffer "E-Mail: " address)) - (if (and (not (string= address new-addr)) - (assoc new-addr wl-address-list)) - (error "'%s' already exists" new-addr))) + (cond + ((or (not (stringp address)) + (string-match "^[ \t]*$" address)) + (error "empty address")) + ((and (not (string= address new-addr)) + (assoc new-addr wl-address-list)) + (error "'%s' already exists" new-addr)) + (t + ;; do nothing + ))) ;; writing to ~/.address (let ((output-coding-system (mime-charset-to-coding-system wl-mime-charset))) -- 1.7.10.4