diff options
| author | David Kastrup | 2004-06-29 02:37:52 +0000 |
|---|---|---|
| committer | David Kastrup | 2004-06-29 02:37:52 +0000 |
| commit | c3762cbd4b8d9569291a20465315a024881eb17c (patch) | |
| tree | 1405cce3196fda17033b272672069feb0e90da38 /src | |
| parent | 637b9d739b052b2235c67839bef235e493a85e33 (diff) | |
| download | emacs-c3762cbd4b8d9569291a20465315a024881eb17c.tar.gz emacs-c3762cbd4b8d9569291a20465315a024881eb17c.zip | |
(Fset_match_data): Allow buffer before end of list
which can happen if set-match-data is using a pre-consed list.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/search.c | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 144e4890e8e..7de0eb69cd3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-06-29 David Kastrup <dak@gnu.org> | ||
| 2 | |||
| 3 | * search.c (Fset_match_data): Allow buffer before end of list | ||
| 4 | which can happen if set-match-data is using a pre-consed list. | ||
| 5 | |||
| 1 | 2004-06-28 Steven Tamm <tamm@Steven-Tamms-Computer.local> | 6 | 2004-06-28 Steven Tamm <tamm@Steven-Tamms-Computer.local> |
| 2 | 7 | ||
| 3 | * macterm.c (XTread_socket): Correctly set the frame position | 8 | * macterm.c (XTread_socket): Correctly set the frame position |
diff --git a/src/search.c b/src/search.c index dc1ca91e38f..bd187181ecf 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2808,9 +2808,16 @@ LIST should have been created by calling `match-data' previously. */) | |||
| 2808 | search_regs.num_regs = length; | 2808 | search_regs.num_regs = length; |
| 2809 | } | 2809 | } |
| 2810 | 2810 | ||
| 2811 | for (i = 0; i < length; i++) | 2811 | for (i = 0;; i++) |
| 2812 | { | 2812 | { |
| 2813 | marker = Fcar (list); | 2813 | marker = Fcar (list); |
| 2814 | if (BUFFERP(marker)) | ||
| 2815 | { | ||
| 2816 | XSETBUFFER(last_thing_searched, marker); | ||
| 2817 | break; | ||
| 2818 | } | ||
| 2819 | if (i >= length) | ||
| 2820 | break; | ||
| 2814 | if (NILP (marker)) | 2821 | if (NILP (marker)) |
| 2815 | { | 2822 | { |
| 2816 | search_regs.start[i] = -1; | 2823 | search_regs.start[i] = -1; |
| @@ -2847,10 +2854,6 @@ LIST should have been created by calling `match-data' previously. */) | |||
| 2847 | search_regs.start[i] = -1; | 2854 | search_regs.start[i] = -1; |
| 2848 | } | 2855 | } |
| 2849 | 2856 | ||
| 2850 | if (CONSP(list) && BUFFERP(XCAR(list))) { | ||
| 2851 | XSETBUFFER(last_thing_searched, XCAR(list)); | ||
| 2852 | } | ||
| 2853 | |||
| 2854 | return Qnil; | 2857 | return Qnil; |
| 2855 | } | 2858 | } |
| 2856 | 2859 | ||