(build-mail-aliases): Don't allow
authorKarl Heuer <kwzh@gnu.org>
Wed, 30 Sep 1998 19:16:47 +0000 (19:16 +0000)
committerKarl Heuer <kwzh@gnu.org>
Wed, 30 Sep 1998 19:16:47 +0000 (19:16 +0000)
a newline in the alias name.  Don't define an alias
if the definition would be empty.

lisp/mail/mailalias.el

index fec940c..f40c460 100644 (file)
@@ -282,14 +282,14 @@ By default, this is the file specified by `mail-personal-alias-file'."
                  (t (setq file nil))))
          (goto-char (point-min))
          (while (re-search-forward
-                 "^\\(a\\|alias\\|g\\|group\\)[ \t]+\\([^ \t]+\\)" nil t)
+                 "^\\(a\\|alias\\|g\\|group\\)[ \t]+\\([^ \t\n]+\\)" nil t)
            (let* ((name (match-string 2))
-                  (start (progn (skip-chars-forward " \t") (point))))
+                  (start (progn (skip-chars-forward " \t") (point)))
+                  value)
              (end-of-line)
-             (define-mail-alias
-               name
-               (buffer-substring-no-properties start (point))
-               t)))
+             (setq value (buffer-substring-no-properties start (point)))
+             (unless (equal value "")
+               (define-mail-alias name value t))))
          mail-aliases)
       (if buffer (kill-buffer buffer))
       (set-buffer obuf))))