changeset 8494:ae554ccf4fb5

(define-mail-alias): Avoid error if DEFINITION is "".
author Richard M. Stallman <rms@gnu.org>
date Tue, 09 Aug 1994 05:52:47 +0000
parents 2bf3f2e9f107
children 27305753852c
files lisp/mail/mailalias.el
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)