(regexp-opt-depth): Fix off-by-two error.

This commit is contained in:
Stefan Monnier 2001-11-28 03:06:10 +00:00
parent d28981c94d
commit 3ccfa82a6c

View 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)))
;;; Workhorse functions.