From 44214c1bc80d73bc461051df98f84dbac2c02313 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 21 Oct 1995 23:15:21 +0000 Subject: [PATCH] (Fnext_single_property_change): Rearrange handling of limit = t; don't return t. --- src/textprop.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/textprop.c b/src/textprop.c index ad41534c3ef..b071b347508 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -624,14 +624,16 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.") CHECK_NUMBER_COERCE_MARKER (limit, 0); i = validate_interval_range (object, &pos, &pos, soft); - if (NULL_INTERVAL_P (i)) - return limit; - next = next_interval (i); /* If LIMIT is t, return start of next interval--don't bother checking further intervals. */ if (EQ (limit, Qt)) { + if (NULL_INTERVAL_P (i)) + next = i; + else + next = next_interval (i); + if (NULL_INTERVAL_P (next)) XSETFASTINT (pos, (STRINGP (object) ? XSTRING (object)->size @@ -641,6 +643,11 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.") return pos; } + if (NULL_INTERVAL_P (i)) + return limit; + + next = next_interval (i); + while (! NULL_INTERVAL_P (next) && intervals_equal (i, next) && (NILP (limit) || next->position < XFASTINT (limit))) next = next_interval (next); -- 2.39.2