From cc6a66b9a154b336a9a460b37ca843eb3b9e94f5 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 16 Jun 2017 10:42:20 +0000 Subject: [PATCH] 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. --- lisp/progmodes/cc-engine.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.39.2