]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fset_match_data): Allow buffer before end of list
authorDavid Kastrup <dak@gnu.org>
Tue, 29 Jun 2004 02:37:52 +0000 (02:37 +0000)
committerDavid Kastrup <dak@gnu.org>
Tue, 29 Jun 2004 02:37:52 +0000 (02:37 +0000)
which can happen if set-match-data is using a pre-consed list.

src/ChangeLog
src/search.c

index 144e4890e8e882028c4929fa6eabaceb840510cf..7de0eb69cd3ad595ce27ec18344d99c0799258b9 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-29  David Kastrup  <dak@gnu.org>
+
+       * search.c (Fset_match_data): Allow buffer before end of list
+       which can happen if set-match-data is using a pre-consed list.
+
 2004-06-28  Steven Tamm  <tamm@Steven-Tamms-Computer.local>
 
        * macterm.c (XTread_socket): Correctly set the frame position
index dc1ca91e38f9e58f94941f277a1dd851e9999911..bd187181ecf5ad126620adcabcc1c0d2a3daa33a 100644 (file)
@@ -2808,9 +2808,16 @@ LIST should have been created by calling `match-data' previously.  */)
        search_regs.num_regs = length;
       }
 
-    for (i = 0; i < length; i++)
+    for (i = 0;; i++)
       {
        marker = Fcar (list);
+       if (BUFFERP(marker))
+         {
+           XSETBUFFER(last_thing_searched, marker);
+           break;
+         }
+       if (i >= length)
+         break;
        if (NILP (marker))
          {
            search_regs.start[i] = -1;
@@ -2847,10 +2854,6 @@ LIST should have been created by calling `match-data' previously.  */)
       search_regs.start[i] = -1;
   }
 
-  if (CONSP(list) && BUFFERP(XCAR(list))) {
-    XSETBUFFER(last_thing_searched, XCAR(list));
-  }
-
   return Qnil;
 }