]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix hang in CC Mode when ":" is typed after identifier at EOB.
authorAlan Mackenzie <acm@muc.de>
Fri, 16 Jun 2017 10:42:20 +0000 (10:42 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 16 Jun 2017 10:42:20 +0000 (10:42 +0000)
* list/progmodes/cc-engine.el (c-forward-declarator): Fix coding error
confusing ":" and EOB.

lisp/progmodes/cc-engine.el

index 9773b1ca85b22972ab7871c6c77e7cb52ee28913..aa84ade083c78b71504c7d9dca29889b3db87a2c 100644 (file)
@@ -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)