changeset 56022:e63446aad5a3

(match_limit): Don't flag an error if match-data exceeding the allocated search_regs.num_regs gets requested, just return Qnil.
author David Kastrup <dak@gnu.org>
date Fri, 11 Jun 2004 00:08:37 +0000
parents ec4ab8d2ba9f
children 7e63582e48f6
files src/ChangeLog src/search.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jun 10 20:59:26 2004 +0000
+++ b/src/ChangeLog	Fri Jun 11 00:08:37 2004 +0000
@@ -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.
--- a/src/search.c	Thu Jun 10 20:59:26 2004 +0000
+++ b/src/search.c	Fri Jun 11 00:08:37 2004 +0000
@@ -2622,9 +2622,9 @@
 
   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]