From: yoichi Date: Sat, 3 Jan 2004 00:14:15 +0000 (+0000) Subject: * wl-address.el (wl-address-add-or-change): Don't add empty X-Git-Tag: wl-2_11_23~11 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=416e4f4cd800613ecdf9f62f4fb3670585dbf296;p=elisp%2Fwanderlust.git * wl-address.el (wl-address-add-or-change): Don't add empty address. --- 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)))