diff --git a/ChangeLog b/ChangeLog index d0e2e82b..1608c376 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,8 @@ Cvs code - - cut.c: add_to_cutbuffer() - Remove useless statements (Rocco). + cut_marked_segment() + - Add bizarre copy of bot node, else *BSD goes ballistic. - faq.html: - Brought the FAQ up to date, many little changes (Jordi). - files.c: diff --git a/cut.c b/cut.c index f5a3232a..487a92cb 100644 --- a/cut.c +++ b/cut.c @@ -61,7 +61,7 @@ void add_to_cutbuffer(filestruct * inptr) void cut_marked_segment(filestruct * top, int top_x, filestruct * bot, int bot_x) { - filestruct *tmp, *next; + filestruct *tmp, *next, *botcopy; char *tmpstr; /* Set up the beginning of the cutbuffer */ @@ -103,7 +103,15 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot, * up a newline when we're grabbing the last line of the mark. For * the same reason, we don't do an extra totsize decrement. */ - add_to_cutbuffer(bot); + + /* I honestly do not know why this is needed. After many hours of + using gdb on an OpenBSD box, I can honestly say something is + screwed somewhere. Not doing this causes update_line to annihilate + the last line copied into the cutbuffer when the mark is set ?!?!? */ + botcopy = copy_node(bot); + add_to_cutbuffer(botcopy); + free(bot); + top->next = next; if (next != NULL) next->prev = top;