summaryrefslogtreecommitdiff
path: root/src/textprop.c
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-05-09 14:06:55 +0100
committerAndrea Corallo <akrl@sdf.org>2020-05-09 14:06:55 +0100
commitc6eb2760766b402fb620a733d100adfd320e4df5 (patch)
tree9a116468d6b11f22a68680d05dd5bfaacd2e0c4c /src/textprop.c
parent40f655e0505d954e507ead5f5bda7dc7113adc06 (diff)
parentae3c510696f02f01d03052f070e5ce65b4018a45 (diff)
downloademacs-c6eb2760766b402fb620a733d100adfd320e4df5.tar.gz
emacs-c6eb2760766b402fb620a733d100adfd320e4df5.tar.bz2
emacs-c6eb2760766b402fb620a733d100adfd320e4df5.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src/textprop.c')
-rw-r--r--src/textprop.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/textprop.c b/src/textprop.c
index 960dba3f8dc..0876badc873 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -766,14 +766,13 @@ the current buffer), POSITION is a buffer position (integer or marker).
If OBJECT is a string, POSITION is a 0-based index into it.
In a string, scan runs to the end of the string, unless LIMIT is non-nil.
-In a buffer, if LIMIT is nil or omitted, it runs to (point-max), and the
-value cannot exceed that.
+In a buffer, scan runs to end of buffer, unless LIMIT is non-nil.
If the optional fourth argument LIMIT is non-nil, don't search
past position LIMIT; return LIMIT if nothing is found before LIMIT.
+However, if OBJECT is a buffer and LIMIT is beyond the end of the
+buffer, this function returns `point-max', not LIMIT.
-The property values are compared with `eq'.
-If the property is constant all the way to the end of OBJECT, return the
-last valid position in OBJECT. */)
+The property values are compared with `eq'. */)
(Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit)
{
if (STRINGP (object))
@@ -832,6 +831,9 @@ last valid position in OBJECT. */)
value = Fget_char_property (position, prop, object);
if (!EQ (value, initial_value))
break;
+
+ if (XFIXNAT (position) >= ZV)
+ break;
}
position = unbind_to (count, position);