diff options
| author | Martin Stjernholm <mast@lysator.liu.se> | 2003-08-26 11:51:16 +0000 |
|---|---|---|
| committer | Martin Stjernholm <mast@lysator.liu.se> | 2003-08-26 11:51:16 +0000 |
| commit | 2c9c19547f065dcfb3058a41c8ac0bc9515467bf (patch) | |
| tree | d05501db89ffcd502f72eafe283cc044ed71665d /lisp | |
| parent | 0b966e89b353095562e29a4af5dff49e70c3a822 (diff) | |
| download | emacs-2c9c19547f065dcfb3058a41c8ac0bc9515467bf.tar.gz | |
(c-just-after-func-arglist-p): Safeguard against unbalanced sexps.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 18 |
1 files 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 |
