From: Stefan Monnier Date: Wed, 28 Nov 2001 03:06:10 +0000 (+0000) Subject: (regexp-opt-depth): Fix off-by-two error. X-Git-Tag: ttn-vms-21-2-B4~18084 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3ccfa82a6c4193d9058ed5d1e7c09f9735bf770b;p=emacs.git (regexp-opt-depth): Fix off-by-two error. --- diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index b6fac1355c1..894cc4c4be7 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -120,7 +120,9 @@ in REGEXP." (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.