diff options
| author | Stefan Monnier | 2005-07-13 04:39:14 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-07-13 04:39:14 +0000 |
| commit | 8a08764f7a72eb062a85733b045fb50291d6aee9 (patch) | |
| tree | 3ce0ef9837855ef7182afad6d403ca650ecacc4f | |
| parent | f3eb269f58126b3ea58fc2a64030b53a48220e6c (diff) | |
| download | emacs-8a08764f7a72eb062a85733b045fb50291d6aee9.tar.gz emacs-8a08764f7a72eb062a85733b045fb50291d6aee9.zip | |
(font-lock-fontify-keywords-region): Avoid inf-loops
when the matched text is empty.
| -rw-r--r-- | lisp/font-lock.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index a1b30292e61..0a97be141df 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1473,7 +1473,11 @@ LOUDLY, if non-nil, allows progress-meter bar." | |||
| 1473 | (while (and (< (point) end) | 1473 | (while (and (< (point) end) |
| 1474 | (if (stringp matcher) | 1474 | (if (stringp matcher) |
| 1475 | (re-search-forward matcher end t) | 1475 | (re-search-forward matcher end t) |
| 1476 | (funcall matcher end))) | 1476 | (funcall matcher end)) |
| 1477 | ;; Beware empty string matches since they will | ||
| 1478 | ;; loop indefinitely. | ||
| 1479 | (or (> (point) (match-beginning 0)) | ||
| 1480 | (progn (forward-char 1) t))) | ||
| 1477 | (when (and font-lock-multiline | 1481 | (when (and font-lock-multiline |
| 1478 | (>= (point) | 1482 | (>= (point) |
| 1479 | (save-excursion (goto-char (match-beginning 0)) | 1483 | (save-excursion (goto-char (match-beginning 0)) |