]> git.eshelyaron.com Git - emacs.git/commitdiff
(match_limit): Don't flag an error if match-data
authorDavid Kastrup <dak@gnu.org>
Fri, 11 Jun 2004 00:08:37 +0000 (00:08 +0000)
committerDavid Kastrup <dak@gnu.org>
Fri, 11 Jun 2004 00:08:37 +0000 (00:08 +0000)
exceeding the allocated search_regs.num_regs gets requested, just
return Qnil.

src/ChangeLog
src/search.c

index d6750648fd537a2d679eee493497ed9d31aeaeb3..98e0b46bc374a5dee023c9b13f71ceab3f60129f 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-11  David Kastrup  <dak@gnu.org>
+
+       * search.c (match_limit): Don't flag an error if match-data
+       exceeding the allocated search_regs.num_regs gets requested, just
+       return Qnil.
+
 2004-06-08  Miles Bader  <miles@gnu.org>
 
        * xfaces.c (push_named_merge_point): Return 0 when a cycle is detected.
index e5e4c3f867a6e5c970d7e390f844b4e877b97e94..24f21f053a59a651935d61c84cc168deeb5dbd78 100644 (file)
@@ -2622,9 +2622,9 @@ match_limit (num, beginningp)
 
   CHECK_NUMBER (num);
   n = XINT (num);
-  if (n < 0 || n >= search_regs.num_regs)
+  if (n < 0 || search_regs.num_regs <= 0)
     args_out_of_range (num, make_number (search_regs.num_regs));
-  if (search_regs.num_regs <= 0
+  if (n >= search_regs.num_regs
       || search_regs.start[n] < 0)
     return Qnil;
   return (make_number ((beginningp) ? search_regs.start[n]