Mercurial > hg > xemacs-beta
diff src/extents.c @ 80:1ce6082ce73f r20-0b90
Import from CVS: tag r20-0b90
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:06:37 +0200 |
parents | 131b0175ea99 |
children | dbb370e3c29e |
line wrap: on
line diff
--- a/src/extents.c Mon Aug 13 09:05:44 2007 +0200 +++ b/src/extents.c Mon Aug 13 09:06:37 2007 +0200 @@ -1968,8 +1968,10 @@ assert (!extent_detached_p (after)); } - if (!buffer_or_string_extent_list (obj)) + el = buffer_or_string_extent_list (obj); + if (!el || !extent_list_num_els(el)) return; + el = 0; st = buffer_or_string_bytind_to_memind (obj, from); en = buffer_or_string_bytind_to_memind (obj, to); @@ -2315,8 +2317,9 @@ #endif el = buffer_or_string_extent_list (obj); - if (!el) + if (!el || !extent_list_num_els(el)) return; + /* IMPORTANT! Compute the starting positions of the extents to modify BEFORE doing any modification! Otherwise the starting position for the second time through the loop might get @@ -2516,7 +2519,7 @@ buffer_or_string_absolute_end_byte (obj) : buffer_or_string_accessible_end_byte (obj); - if (!bel) + if (!bel || !extent_list_num_els(bel)) return limit; sel = buffer_or_string_stack_of_extents_force (obj)->extents; @@ -2556,7 +2559,7 @@ buffer_or_string_absolute_begin_byte (obj) : buffer_or_string_accessible_begin_byte (obj); - if (!bel) + if (!bel || !extent_list_num_els(bel)) return limit; sel = buffer_or_string_stack_of_extents_force (obj)->extents;