# HG changeset patch # User Richard M. Stallman # Date 776411567 0 # Node ID ae554ccf4fb5cbc1fc52de7a720850414202696a # Parent 2bf3f2e9f107a2b4c238b4f27eedb7f35afbcbe3 (define-mail-alias): Avoid error if DEFINITION is "". diff -r 2bf3f2e9f107 -r ae554ccf4fb5 lisp/mail/mailalias.el --- a/lisp/mail/mailalias.el Tue Aug 09 05:42:35 1994 +0000 +++ b/lisp/mail/mailalias.el Tue Aug 09 05:52:47 1994 +0000 @@ -178,7 +178,8 @@ (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 @@ (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)