diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-05-15 21:50:07 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-05-15 21:50:07 +0000 |
commit | 8332fa80b6fc27d93719218a7cdbf71ea9533b8a (patch) | |
tree | 3d6b0013890f0cb7929d6257df219ae46af86057 /lisp/mail | |
parent | b44c3d59fafe7eaa74ee546e2322a483e84cbfd3 (diff) | |
download | emacs-8332fa80b6fc27d93719218a7cdbf71ea9533b8a.tar.gz |
(define-mail-alias): Compensate for not resetting the match data when
string-match fails.
Diffstat (limited to 'lisp/mail')
-rw-r--r-- | lisp/mail/mailalias.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 176bfd80163..9d15345dd43 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -334,10 +334,14 @@ if it is quoted with double-quotes." ;; double-quotes. Otherwise, addresses are separated by commas. (if from-mailrc-file (if (eq ?\" (aref definition start)) - (progn (string-match "[^\\]\\(\\([\\][\\]\\)*\\)\"[ \t,]*" definition start) - (setq start (1+ start) - end (match-end 1) - convert-backslash t)) + ;; The following test on `found' compensates for a bug + ;; in match-end, which does not return nil when match + ;; failed. + (let ((found (string-match "[^\\]\\(\\([\\][\\]\\)*\\)\"[ \t,]*" + definition start))) + (setq start (1+ start) + end (and found (match-end 1)) + convert-backslash t)) (setq end (string-match "[ \t,]+" definition start))) (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start))) (let ((temp (substring definition start end)) |