1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 19:00:55 -08:00

(define-mail-alias): Avoid error if DEFINITION is "".

This commit is contained in:
Richard M. Stallman 1994-08-09 05:52:47 +00:00
parent bd21cb17b7
commit cc4b6c0239

View file

@ -178,7 +178,8 @@ An address can contain spaces if it is quoted with double-quotes."
(if (string-match "[ \t\n,]+\\'" definition) (if (string-match "[ \t\n,]+\\'" definition)
(setq definition (substring definition 0 (match-beginning 0)))) (setq definition (substring definition 0 (match-beginning 0))))
(let ((result '()) (let ((result '())
(start 0) ;; If DEFINITION is null string, avoid looping even once.
(start (and (not (equal definition "")) 0))
(L (length definition)) (L (length definition))
end tem) end tem)
(while start (while start
@ -189,8 +190,8 @@ An address can contain spaces if it is quoted with double-quotes."
(if (eq ?\" (aref definition start)) (if (eq ?\" (aref definition start))
(setq start (1+ start) (setq start (1+ start)
end (string-match "\"[ \t,]*" definition start)) end (string-match "\"[ \t,]*" definition start))
(setq 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\n,]*,[ \t\n,]*" definition start)))
(setq result (cons (substring definition start end) result)) (setq result (cons (substring definition start end) result))
(setq start (and end (setq start (and end
(/= (match-end 0) L) (/= (match-end 0) L)