From 2c9c19547f065dcfb3058a41c8ac0bc9515467bf Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Tue, 26 Aug 2003 11:51:16 +0000 Subject: [PATCH] (c-just-after-func-arglist-p): Safeguard against unbalanced sexps. --- lisp/progmodes/cc-engine.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 15acecfa2a8..32cd56d0ac3 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -4272,14 +4272,16 @@ brace." ;; otherwise, we could be looking at a hanging member init ;; colon (goto-char checkpoint) - (while (eq (char-before) ?,) - ;; this will catch member inits with multiple - ;; line arglists - (forward-char -1) - (c-backward-syntactic-ws (c-point 'bol)) - (if (eq (char-before) ?\)) - (c-backward-sexp 2) - (c-backward-sexp 1)) + (while (and + (eq (char-before) ?,) + ;; this will catch member inits with multiple + ;; line arglists + (progn + (forward-char -1) + (c-backward-syntactic-ws (c-point 'bol)) + (c-safe (c-backward-sexp 1) t)) + (or (not (looking-at "\\s\(")) + (c-safe (c-backward-sexp 1) t))) (c-backward-syntactic-ws lim)) (if (and (eq (char-before) ?:) (progn -- 2.39.2