summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2007-03-18 14:34:18 +0000
committerJuanma Barranquero <lekktu@gmail.com>2007-03-18 14:34:18 +0000
commit640eb069c5b01f92c29a8d34cee09799bfa6c7f1 (patch)
tree1b00742321eed0d03f01c60e91c285a53e3504d4 /lisp/emacs-lisp
parent904bb06ca2720f78b96c0509c961dafa2f78d233 (diff)
downloademacs-640eb069c5b01f92c29a8d34cee09799bfa6c7f1.tar.gz
emacs-640eb069c5b01f92c29a8d34cee09799bfa6c7f1.tar.bz2
emacs-640eb069c5b01f92c29a8d34cee09799bfa6c7f1.zip
(reb-update-overlays): Do not mark zero-width regexps as invalid
but rather at least count them correctly.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/re-builder.el6
1 files changed, 4 insertions, 2 deletions
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))