diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c index c1c0441a70e..b55284a4a26 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -3120,14 +3120,13 @@ overlays_in (ptrdiff_t beg, ptrdiff_t end, bool extend, | |||
| 3120 | { | 3120 | { |
| 3121 | ptrdiff_t idx = 0; | 3121 | ptrdiff_t idx = 0; |
| 3122 | ptrdiff_t len = *len_ptr; | 3122 | ptrdiff_t len = *len_ptr; |
| 3123 | ptrdiff_t next = ZV; | 3123 | ptrdiff_t next = Z; |
| 3124 | Lisp_Object *vec = *vec_ptr; | 3124 | Lisp_Object *vec = *vec_ptr; |
| 3125 | struct itree_node *node; | 3125 | struct itree_node *node; |
| 3126 | 3126 | ||
| 3127 | /* Extend the search range if overlays beginning at ZV are | 3127 | /* Extend the search range if overlays beginning at Z are wanted. */ |
| 3128 | wanted. */ | 3128 | ptrdiff_t search_end = Z; |
| 3129 | ptrdiff_t search_end = ZV; | 3129 | if (end >= Z && (empty || trailing)) |
| 3130 | if (end >= ZV && (empty || trailing)) | ||
| 3131 | ++search_end; | 3130 | ++search_end; |
| 3132 | 3131 | ||
| 3133 | ITREE_FOREACH (node, current_buffer->overlays, beg, search_end, | 3132 | ITREE_FOREACH (node, current_buffer->overlays, beg, search_end, |
| @@ -3141,7 +3140,7 @@ overlays_in (ptrdiff_t beg, ptrdiff_t end, bool extend, | |||
| 3141 | else if (node->begin == end) | 3140 | else if (node->begin == end) |
| 3142 | { | 3141 | { |
| 3143 | next = node->begin; | 3142 | next = node->begin; |
| 3144 | if ((! empty || end < ZV) && beg < end) | 3143 | if ((! empty || end < Z) && beg < end) |
| 3145 | break; | 3144 | break; |
| 3146 | if (empty && node->begin != node->end) | 3145 | if (empty && node->begin != node->end) |
| 3147 | continue; | 3146 | continue; |
| @@ -3168,7 +3167,7 @@ overlays_in (ptrdiff_t beg, ptrdiff_t end, bool extend, | |||
| 3168 | idx++; | 3167 | idx++; |
| 3169 | } | 3168 | } |
| 3170 | if (next_ptr) | 3169 | if (next_ptr) |
| 3171 | *next_ptr = next ? next : ZV; | 3170 | *next_ptr = next ? next : Z; |
| 3172 | 3171 | ||
| 3173 | return idx; | 3172 | return idx; |
| 3174 | } | 3173 | } |