]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Fix looping in patch from yesterday
authorAlan Mackenzie <acm@muc.de>
Sun, 7 Aug 2022 12:26:16 +0000 (12:26 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 7 Aug 2022 12:26:16 +0000 (12:26 +0000)
* 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

index ca4df2d1c7e189b44295c5006f7ba894a5903851..027fd8f42f53c1ab52436f83e7779167d6160ceb 100644 (file)
@@ -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))