From: Alan Mackenzie Date: Fri, 16 Jun 2017 10:42:20 +0000 (+0000) Subject: Fix hang in CC Mode when ":" is typed after identifier at EOB. X-Git-Tag: emacs-26.0.90~521^2~64 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cc6a66b9a154b336a9a460b37ca843eb3b9e94f5;p=emacs.git Fix hang in CC Mode when ":" is typed after identifier at EOB. * list/progmodes/cc-engine.el (c-forward-declarator): Fix coding error confusing ":" and EOB. --- diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 9773b1ca85b..aa84ade083c 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -8100,7 +8100,7 @@ comment at the start of cc-engine.el for more info." (and (setq found (c-syntactic-re-search-forward - "[;:,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" + "[;:,]\\|\\s)\\|\\(=\\|\\s(\\)" limit t t)) (eq (char-before) ?:) (if (looking-at c-:-op-cont-regexp) @@ -8118,8 +8118,8 @@ comment at the start of cc-engine.el for more info." (eq (char-before) ?\[) (c-go-up-list-forward)) (setq brackets-after-id t)) - (backward-char) - found)) + (when found (backward-char)) + t)) (list id-start id-end brackets-after-id (match-beginning 1) decorated) (goto-char here)