diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-08-09 05:52:47 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-08-09 05:52:47 +0000 |
commit | 0130ea7ae8e02034f67bd106309f40022cc150e5 (patch) | |
tree | 18c9d9096ad72ede1352d4bddcd70f344842d880 /lisp | |
parent | b905929f160c1fe23ea783af710345b1d9a8d77c (diff) | |
download | emacs-0130ea7ae8e02034f67bd106309f40022cc150e5.tar.gz |
(define-mail-alias): Avoid error if DEFINITION is "".
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mail/mailalias.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 25d52cfae23..6addb3c5a90 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -178,7 +178,8 @@ An address can contain spaces if it is quoted with double-quotes." (if (string-match "[ \t\n,]+\\'" definition) (setq definition (substring definition 0 (match-beginning 0)))) (let ((result '()) - (start 0) + ;; If DEFINITION is null string, avoid looping even once. + (start (and (not (equal definition "")) 0)) (L (length definition)) end tem) (while start @@ -189,8 +190,8 @@ An address can contain spaces if it is quoted with double-quotes." (if (eq ?\" (aref definition start)) (setq start (1+ start) end (string-match "\"[ \t,]*" definition start)) - (setq end (string-match "[ \t,]+" definition start))) - (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start))) + (setq end (string-match "[ \t,]+" definition start))) + (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start))) (setq result (cons (substring definition start end) result)) (setq start (and end (/= (match-end 0) L) |