From bf5b1e26c1a1c965aca2ddf4fe06bcce2ddce9d0 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sat, 23 Aug 2014 11:02:20 +0000 Subject: [PATCH] progmodes/cc-fonts.el (c-font-lock-declarators): Fix infinite loop, bug #18306. The bug was introduced on 2014-08-02. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-fonts.el | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0620164c6dd..920eea268f4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-08-23 Alan Mackenzie + + * progmodes/cc-fonts.el (c-font-lock-declarators): Fix infinite + loop, bug #18306. The bug was introduced on 2014-08-02. + 2014-08-21 Eli Zaretskii * textmodes/texnfo-upd.el (texinfo-specific-section-type): Don't diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index a107ef01250..ceb86b45fb1 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -1116,14 +1116,11 @@ casts and declarations are fontified. Used on level 2 and higher." ;; initializing brace lists. (let (found) (while - (and (setq found - (c-syntactic-re-search-forward - "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t)) - (eq (char-before) ?\[)) - (backward-char) - (c-safe (c-forward-sexp 1)) - (setq found nil) - (setq brackets-after-id t)) + (and (setq found (c-syntactic-re-search-forward + "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t)) + (eq (char-before) ?\[) + (c-go-up-list-forward)) + (setq brackets-after-id t)) found)) (setq next-pos (match-beginning 0) -- 2.11.4.GIT