changeset 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 6486180ed9ef
children fde712c2fd73
files lisp/emacs-lisp/regexp-opt.el
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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.