diff options
| author | Juanma Barranquero | 2007-03-18 14:34:18 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2007-03-18 14:34:18 +0000 |
| commit | 640eb069c5b01f92c29a8d34cee09799bfa6c7f1 (patch) | |
| tree | 1b00742321eed0d03f01c60e91c285a53e3504d4 | |
| parent | 904bb06ca2720f78b96c0509c961dafa2f78d233 (diff) | |
| download | emacs-640eb069c5b01f92c29a8d34cee09799bfa6c7f1.tar.gz emacs-640eb069c5b01f92c29a8d34cee09799bfa6c7f1.zip | |
(reb-update-overlays): Do not mark zero-width regexps as invalid
but rather at least count them correctly.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/re-builder.el | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 32b3e71373d..35a8ed78943 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-03-18 Detlev Zundel <dzu@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/re-builder.el (reb-update-overlays): Do not mark zero-width | ||
| 4 | regexps as invalid but rather at least count them correctly. | ||
| 5 | |||
| 1 | 2007-03-18 Thien-Thi Nguyen <ttn@gnu.org> | 6 | 2007-03-18 Thien-Thi Nguyen <ttn@gnu.org> |
| 2 | 7 | ||
| 3 | * net/tls.el (open-tls-stream): In handshake-waiting loop, | 8 | * 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." | |||
| 639 | (set-buffer reb-target-buffer) | 639 | (set-buffer reb-target-buffer) |
| 640 | (reb-delete-overlays) | 640 | (reb-delete-overlays) |
| 641 | (goto-char (point-min)) | 641 | (goto-char (point-min)) |
| 642 | (while (and (re-search-forward re (point-max) t) | 642 | (while (and (not (eobp)) |
| 643 | (re-search-forward re (point-max) t) | ||
| 643 | (or (not reb-auto-match-limit) | 644 | (or (not reb-auto-match-limit) |
| 644 | (< matches reb-auto-match-limit))) | 645 | (< matches reb-auto-match-limit))) |
| 645 | (if (= 0 (length (match-string 0))) | 646 | (if (= 0 (length (match-string 0))) |
| 646 | (error "Empty regular expression!")) | 647 | (unless (eobp) |
| 648 | (forward-char 1))) | ||
| 647 | (let ((i 0) | 649 | (let ((i 0) |
| 648 | suffix max-suffix) | 650 | suffix max-suffix) |
| 649 | (setq matches (1+ matches)) | 651 | (setq matches (1+ matches)) |