From a332034160bf8e1f38039cd2d37898de6f94508f Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sun, 7 Aug 2022 12:26:16 +0000 Subject: [PATCH] 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. --- lisp/progmodes/cc-mode.el | 8 ++++++-- 1 file 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)) -- 2.39.2