]> git.eshelyaron.com Git - emacs.git/commitdiff
(regexp-opt-depth): Fix off-by-two error.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 28 Nov 2001 03:06:10 +0000 (03:06 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 28 Nov 2001 03:06:10 +0000 (03:06 +0000)
lisp/emacs-lisp/regexp-opt.el

index b6fac1355c1c141ef24c8fd477051819d21902f1..894cc4c4be7f9fafadef957812223e3768b30e40 100644 (file)
@@ -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)))
 \f
 ;;; Workhorse functions.