From: Alan Mackenzie Date: Mon, 22 Mar 2010 17:21:22 +0000 (+0000) Subject: cc-engine.el (c-remove-stale-state-cache): Fix off-by-one error. Fixes X-Git-Tag: emacs-pretest-23.1.95~51 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=657071fc073b054db83168daffbbc1ce8ff89527;p=emacs.git cc-engine.el (c-remove-stale-state-cache): Fix off-by-one error. Fixes bug #5747. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1d650a2ef58..98ebc73fd3e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-03-22 Alan Mackenzie + + * progmodes/cc-engine.el (c-remove-stale-state-cache): Fix + off-by-one error. Fixes bug #5747. + 2010-03-22 Juanma Barranquero * image-dired.el (image-dired-display-thumbs): Fix typo in docstring. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index f4a8c0bf46f..2d28d003fd5 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2624,7 +2624,7 @@ comment at the start of cc-engine.el for more info." (< (point-max) c-state-old-cpp-end))) (point-max) (min (point-max) c-state-old-cpp-beg))) - (while (and c-state-cache (> (c-state-cache-top-lparen) upper-lim)) + (while (and c-state-cache (>= (c-state-cache-top-lparen) upper-lim)) (setq c-state-cache (cdr c-state-cache))) ;; If `upper-lim' is inside the last recorded brace pair, remove its ;; RBrace and indicate we'll need to search backwards for a previous