diff options
| author | Richard M. Stallman | 1994-08-09 05:52:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-08-09 05:52:47 +0000 |
| commit | cc4b6c0239670d4eeaa803bd740a5ec9e1e1d18c (patch) | |
| tree | 3274ed4f1d9f38f8e0f5a32e5de7b718154a1607 | |
| parent | bd21cb17b7d63dde6f81e0076c8e41c5f9f45475 (diff) | |
| download | emacs-cc4b6c0239670d4eeaa803bd740a5ec9e1e1d18c.tar.gz emacs-cc4b6c0239670d4eeaa803bd740a5ec9e1e1d18c.zip | |
(define-mail-alias): Avoid error if DEFINITION is "".
| -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." | |||
| 178 | (if (string-match "[ \t\n,]+\\'" definition) | 178 | (if (string-match "[ \t\n,]+\\'" definition) |
| 179 | (setq definition (substring definition 0 (match-beginning 0)))) | 179 | (setq definition (substring definition 0 (match-beginning 0)))) |
| 180 | (let ((result '()) | 180 | (let ((result '()) |
| 181 | (start 0) | 181 | ;; If DEFINITION is null string, avoid looping even once. |
| 182 | (start (and (not (equal definition "")) 0)) | ||
| 182 | (L (length definition)) | 183 | (L (length definition)) |
| 183 | end tem) | 184 | end tem) |
| 184 | (while start | 185 | (while start |
| @@ -189,8 +190,8 @@ An address can contain spaces if it is quoted with double-quotes." | |||
| 189 | (if (eq ?\" (aref definition start)) | 190 | (if (eq ?\" (aref definition start)) |
| 190 | (setq start (1+ start) | 191 | (setq start (1+ start) |
| 191 | end (string-match "\"[ \t,]*" definition start)) | 192 | end (string-match "\"[ \t,]*" definition start)) |
| 192 | (setq end (string-match "[ \t,]+" definition start))) | 193 | (setq end (string-match "[ \t,]+" definition start))) |
| 193 | (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start))) | 194 | (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start))) |
| 194 | (setq result (cons (substring definition start end) result)) | 195 | (setq result (cons (substring definition start end) result)) |
| 195 | (setq start (and end | 196 | (setq start (and end |
| 196 | (/= (match-end 0) L) | 197 | (/= (match-end 0) L) |