changeset 64265:dde987aec664

(font-lock-fontify-keywords-region): Avoid inf-loops when the matched text is empty.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 13 Jul 2005 04:39:14 +0000
parents 566a139a0315
children a634aa374675
files lisp/font-lock.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/font-lock.el	Tue Jul 12 23:29:29 2005 +0000
+++ b/lisp/font-lock.el	Wed Jul 13 04:39:14 2005 +0000
@@ -1473,7 +1473,11 @@
       (while (and (< (point) end)
 		  (if (stringp matcher)
 		      (re-search-forward matcher end t)
-		    (funcall matcher end)))
+		    (funcall matcher end))
+                  ;; Beware empty string matches since they will
+                  ;; loop indefinitely.
+                  (or (> (point) (match-beginning 0))
+                      (progn (forward-char 1) t)))
 	(when (and font-lock-multiline
 		   (>= (point)
 		       (save-excursion (goto-char (match-beginning 0))