summaryrefslogtreecommitdiff
path: root/lisp/progmodes/c-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/c-mode.el')
-rw-r--r--lisp/progmodes/c-mode.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el
index d51e67586c0..b92fe6ec819 100644
--- a/lisp/progmodes/c-mode.el
+++ b/lisp/progmodes/c-mode.el
@@ -558,7 +558,8 @@ Returns nil if line starts inside a string, t if in a comment."
;; Recognize the DEFUN macro in Emacs.
(if (save-excursion
;; Move down to the (putative) argnames line.
- (while (not (looking-at " *[({}#/]"))
+ (while (and (not (eobp))
+ (not (looking-at " *[({}#/]")))
(forward-line 1))
;; Go back to the DEFUN, if it is one.
(condition-case nil