aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-15 21:50:07 +0000
committerRichard M. Stallman1998-05-15 21:50:07 +0000
commit8332fa80b6fc27d93719218a7cdbf71ea9533b8a (patch)
tree3d6b0013890f0cb7929d6257df219ae46af86057
parentb44c3d59fafe7eaa74ee546e2322a483e84cbfd3 (diff)
downloademacs-8332fa80b6fc27d93719218a7cdbf71ea9533b8a.tar.gz
emacs-8332fa80b6fc27d93719218a7cdbf71ea9533b8a.zip
(define-mail-alias): Compensate for not resetting the match data when
string-match fails.
-rw-r--r--lisp/mail/mailalias.el12
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."
334 ;; double-quotes. Otherwise, addresses are separated by commas. 334 ;; double-quotes. Otherwise, addresses are separated by commas.
335 (if from-mailrc-file 335 (if from-mailrc-file
336 (if (eq ?\" (aref definition start)) 336 (if (eq ?\" (aref definition start))
337 (progn (string-match "[^\\]\\(\\([\\][\\]\\)*\\)\"[ \t,]*" definition start) 337 ;; The following test on `found' compensates for a bug
338 (setq start (1+ start) 338 ;; in match-end, which does not return nil when match
339 end (match-end 1) 339 ;; failed.
340 convert-backslash t)) 340 (let ((found (string-match "[^\\]\\(\\([\\][\\]\\)*\\)\"[ \t,]*"
341 definition start)))
342 (setq start (1+ start)
343 end (and found (match-end 1))
344 convert-backslash t))
341 (setq end (string-match "[ \t,]+" definition start))) 345 (setq end (string-match "[ \t,]+" definition start)))
342 (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start))) 346 (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start)))
343 (let ((temp (substring definition start end)) 347 (let ((temp (substring definition start end))