From: Juanma Barranquero Date: Sun, 18 Mar 2007 14:34:18 +0000 (+0000) Subject: (reb-update-overlays): Do not mark zero-width regexps as invalid X-Git-Tag: emacs-pretest-22.0.96~72 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=640eb069c5b01f92c29a8d34cee09799bfa6c7f1;p=emacs.git (reb-update-overlays): Do not mark zero-width regexps as invalid but rather at least count them correctly. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 32b3e71373d..35a8ed78943 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-03-18 Detlev Zundel + + * emacs-lisp/re-builder.el (reb-update-overlays): Do not mark zero-width + regexps as invalid but rather at least count them correctly. + 2007-03-18 Thien-Thi Nguyen * net/tls.el (open-tls-stream): In handshake-waiting loop, diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index dc4562ab9bb..2d3b4832cda 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -639,11 +639,13 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions." (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))