# HG changeset patch
# User Stefan Monnier <monnier@iro.umontreal.ca>
# Date 1006916770 0
# Node ID 8ba7e2feceadb8ba9a5ef7910a9f74002077abdb
# Parent  6486180ed9ef7f9596955603da79f1afd5aa2e00
(regexp-opt-depth): Fix off-by-two error.

diff -r 6486180ed9ef -r 8ba7e2fecead lisp/emacs-lisp/regexp-opt.el
--- 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.