Mercurial > hg > xemacs-beta
diff src/extents.c @ 14:9ee227acff29 r19-15b90
Import from CVS: tag r19-15b90
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:48:42 +0200 |
parents | ac2d302a0011 |
children | 0293115a14e9 |
line wrap: on
line diff
--- a/src/extents.c Mon Aug 13 08:48:18 2007 +0200 +++ b/src/extents.c Mon Aug 13 08:48:42 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;