]> git.eshelyaron.com Git - emacs.git/commitdiff
(define-mail-alias): Avoid error if DEFINITION is "".
authorRichard M. Stallman <rms@gnu.org>
Tue, 9 Aug 1994 05:52:47 +0000 (05:52 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 9 Aug 1994 05:52:47 +0000 (05:52 +0000)
lisp/mail/mailalias.el

index 25d52cfae23b333bdc98b20d2a536f5cfaa2efba..6addb3c5a90503189ee7824443c38fa670e6b154 100644 (file)
@@ -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)