# HG changeset patch # User Juanma Barranquero # Date 1174228184 0 # Node ID 2f2e0b6d33c081cb6df923e49e3b1a66d5d851eb # Parent e182631d271300fabfb0974941b40f0f2f2b7a85 (reb-update-overlays): Do not mark zero-width regexps as invalid but rather at least count them correctly. diff -r e182631d2713 -r 2f2e0b6d33c0 lisp/emacs-lisp/re-builder.el --- a/lisp/emacs-lisp/re-builder.el Sun Mar 18 11:41:42 2007 +0000 +++ b/lisp/emacs-lisp/re-builder.el Sun Mar 18 14:29:44 2007 +0000 @@ -639,11 +639,13 @@ (set-buffer reb-target-buffer) (reb-delete-overlays) (goto-char (point-min)) - (while (and (re-search-forward re (point-max) t) + (while (and (not (eobp)) + (re-search-forward re (point-max) t) (or (not reb-auto-match-limit) (< matches reb-auto-match-limit))) (if (= 0 (length (match-string 0))) - (error "Empty regular expression!")) + (unless (eobp) + (forward-char 1))) (let ((i 0) suffix max-suffix) (setq matches (1+ matches))