summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-mode.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2022-08-07 12:26:16 +0000
committerAlan Mackenzie <acm@muc.de>2022-08-07 12:26:16 +0000
commita332034160bf8e1f38039cd2d37898de6f94508f (patch)
tree2272e23101bb9b62179ffa169eedc054eafcfb91 /lisp/progmodes/cc-mode.el
parentc8833ba365b8476271b64fbd985d1cf7b1a9ad02 (diff)
downloademacs-a332034160bf8e1f38039cd2d37898de6f94508f.tar.gz
emacs-a332034160bf8e1f38039cd2d37898de6f94508f.tar.bz2
emacs-a332034160bf8e1f38039cd2d37898de6f94508f.zip
CC Mode: Fix looping in patch from yesterday
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings) (c-after-change-mark-abnormal-strings): Check (eobp) in loops advancing over escaped newlines.
Diffstat (limited to 'lisp/progmodes/cc-mode.el')
-rw-r--r--lisp/progmodes/cc-mode.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index ca4df2d1c7e..027fd8f42f5 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1520,7 +1520,9 @@ Note that the style variables are always made local to the buffer."
;; was before unescaping a NL.)
(while
(progn (end-of-line)
- (eq (char-before) ?\\))
+ (and
+ (eq (char-before) ?\\)
+ (not (eobp))))
(forward-line))
;; We're at an EOLL or point-max.
(if (equal (c-get-char-property (point) 'syntax-table) '(15))
@@ -1641,7 +1643,9 @@ Note that the style variables are always made local to the buffer."
end))
(while
(progn (end-of-line)
- (eq (char-before) ?\\))
+ (and
+ (eq (char-before) ?\\)
+ (not (eobp))))
(forward-line))
(point))
c-new-END))