From: Stefan Monnier Date: Wed, 28 Nov 2001 03:01:42 +0000 (+0000) Subject: (regexp-opt-depth): Fix off-by-two error. X-Git-Tag: emacs-21.2~265 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38d1aa59557cea580b0dbf0748ec83a363ab3c60;p=emacs.git (regexp-opt-depth): Fix off-by-two error. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 828068349b2..ecd695e684f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,14 +1,18 @@ +2001-11-27 Stefan Monnier + + * emacs-lisp/regexp-opt.el (regexp-opt-depth): Fix off-by-two error. + 2001-11-21 Richard M. Stallman - * files.el (temporary-file-directory, null-device) + * files.el (temporary-file-directory, null-device) (small-temporary-file-directory): Definitions moved up. * international/encoded-kb.el: Don't alter minor-mode-alist. 2001-11-20 Kai Grossjohann - * files.el (auto-save-file-name-transforms): Put remote files in - temporary-file-directory rather than /tmp. + * files.el (auto-save-file-name-transforms): Put remote files in + temporary-file-directory rather than /tmp. 2001-11-20 Stefan Monnier 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.