From: Alan Mackenzie Date: Sun, 7 Aug 2022 12:26:16 +0000 (+0000) Subject: CC Mode: Fix looping in patch from yesterday X-Git-Tag: emacs-29.0.90~1447^2~344 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a332034160bf8e1f38039cd2d37898de6f94508f;p=emacs.git 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. --- 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))