# HG changeset patch # User Richard M. Stallman # Date 1064925199 0 # Node ID 32ebe48159a64af19d623c61148903495778c3ae # Parent 06b72306eaae8fd30c2409f734ed3d9398b693fe (graft_intervals_into_buffer): Handle over_used when splitting UNDER. Set BUF_INTERVALS (buffer)->up_obj when appropriate. diff -r 06b72306eaae -r 32ebe48159a6 src/intervals.c --- a/src/intervals.c Tue Sep 30 11:47:57 2003 +0000 +++ b/src/intervals.c Tue Sep 30 12:33:19 2003 +0000 @@ -1746,6 +1746,7 @@ XSETBUFFER (buf, buffer); BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf); BUF_INTERVALS (buffer)->position = BEG; + BUF_INTERVALS (buffer)->up_obj = 1; /* Explicitly free the old tree here? */ @@ -1768,6 +1769,7 @@ { BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree)); BUF_INTERVALS (buffer)->position = BEG; + BUF_INTERVALS (buffer)->up_obj = 1; /* Explicitly free the old tree here. */ return; @@ -1823,9 +1825,9 @@ while (! NULL_INTERVAL_P (over)) { /* If UNDER is longer than OVER, split it. */ - if (LENGTH (over) < LENGTH (under)) + if (LENGTH (over) - over_used < LENGTH (under)) { - this = split_interval_left (under, LENGTH (over)); + this = split_interval_left (under, LENGTH (over) - over_used); copy_properties (under, this); } else