diff src/textprop.c @ 60815:21c196c81d60

(Fnext_char_property_change) (Fprevious_char_property_change): allow marker as limit. (Fnext_single_char_property_change) (Fprevious_single_char_property_change): Check that limit is a number in strings. (Fnext_single_char_property_change): Coerce position to integer. (Fprevious_single_char_property_change): Same here.
author David Kastrup <dak@gnu.org>
date Tue, 22 Mar 2005 16:04:02 +0000
parents c4f6faab46b0
children a8fa7c632ee4 13796b0653c7
line wrap: on
line diff
--- a/src/textprop.c	Tue Mar 22 11:58:28 2005 +0000
+++ b/src/textprop.c	Tue Mar 22 16:04:02 2005 +0000
@@ -729,7 +729,7 @@
   temp = Fnext_overlay_change (position);
   if (! NILP (limit))
     {
-      CHECK_NUMBER (limit);
+      CHECK_NUMBER_COERCE_MARKER (limit);
       if (XINT (limit) < XINT (temp))
 	temp = limit;
     }
@@ -754,7 +754,7 @@
   temp = Fprevious_overlay_change (position);
   if (! NILP (limit))
     {
-      CHECK_NUMBER (limit);
+      CHECK_NUMBER_COERCE_MARKER (limit);
       if (XINT (limit) > XINT (temp))
 	temp = limit;
     }
@@ -787,7 +787,10 @@
 	  if (NILP (limit))
 	    position = make_number (SCHARS (object));
 	  else
-	    position = limit;
+	    {
+	      CHECK_NUMBER (limit);
+	      position = limit;
+	    }
 	}
     }
   else
@@ -804,6 +807,8 @@
 	  Fset_buffer (object);
 	}
 
+      CHECK_NUMBER_COERCE_MARKER (position);
+
       initial_value = Fget_char_property (position, prop, object);
 
       if (NILP (limit))
@@ -856,7 +861,10 @@
 	  if (NILP (limit))
 	    position = make_number (SCHARS (object));
 	  else
-	    position = limit;
+	    {
+	      CHECK_NUMBER (limit);
+	      position = limit;
+	    }
 	}
     }
   else
@@ -872,6 +880,8 @@
 	  Fset_buffer (object);
 	}
 
+      CHECK_NUMBER_COERCE_MARKER (position);
+
       if (NILP (limit))
 	XSETFASTINT (limit, BUF_BEGV (current_buffer));
       else