# HG changeset patch # User Richard M. Stallman # Date 895269007 0 # Node ID 0f4e461dd6914caf3220a0ac1005f70ada1b62ca # Parent f519dedee9bc00c90134e698d737ae62bd03642d (define-mail-alias): Compensate for not resetting the match data when string-match fails. diff -r f519dedee9bc -r 0f4e461dd691 lisp/mail/mailalias.el --- a/lisp/mail/mailalias.el Fri May 15 20:55:45 1998 +0000 +++ b/lisp/mail/mailalias.el Fri May 15 21:50:07 1998 +0000 @@ -334,10 +334,14 @@ ;; 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))