Mercurial > emacs
diff lisp/emacs-lisp/regexp-opt.el @ 41616:8ba7e2fecead
(regexp-opt-depth): Fix off-by-two error.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 28 Nov 2001 03:06:10 +0000 |
parents | 253f761ad37b |
children | fde712c2fd73 |
line wrap: on
line diff
--- a/lisp/emacs-lisp/regexp-opt.el Tue Nov 27 19:28:52 2001 +0000 +++ b/lisp/emacs-lisp/regexp-opt.el Wed Nov 28 03:06:10 2001 +0000 @@ -120,7 +120,9 @@ (let ((count 0) start) (while (string-match "\\(\\`\\|[^\\]\\)\\\\\\(\\\\\\\\\\)*([^?]" regexp start) - (setq count (1+ count) start (match-end 0))) + (setq count (1+ count) + ;; Go back 2 chars (one for [^?] and one for [^\\]). + start (- (match-end 0) 2)) count))) ;;; Workhorse functions.