=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rcs/diff3.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/rcs/diff3.c 2006/08/07 20:55:28 1.12 --- src/usr.bin/rcs/diff3.c 2006/08/08 10:22:01 1.13 *************** *** 1,4 **** ! /* $OpenBSD: diff3.c,v 1.12 2006/08/07 20:55:28 ray Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. --- 1,4 ---- ! /* $OpenBSD: diff3.c,v 1.13 2006/08/08 10:22:01 espie Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. *************** *** 72,78 **** #ifndef lint static const char rcsid[] = ! "$OpenBSD: diff3.c,v 1.12 2006/08/07 20:55:28 ray Exp $"; #endif /* not lint */ #include "includes.h" --- 72,78 ---- #ifndef lint static const char rcsid[] = ! "$OpenBSD: diff3.c,v 1.13 2006/08/08 10:22:01 espie Exp $"; #endif /* not lint */ #include "includes.h" *************** *** 414,420 **** ed_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines) { char op, *ep; ! struct rcs_line *sort, *lp, *dlp, *ndlp; int start, end, i, lineno; dlp = TAILQ_FIRST(&(dlines->l_lines)); --- 414,420 ---- ed_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines) { char op, *ep; ! struct rcs_line *sort, *lp, *dlp, *ndlp, *insert_after; int start, end, i, lineno; dlp = TAILQ_FIRST(&(dlines->l_lines)); *************** *** 465,476 **** if (op == 'c') { for (i = 0; i <= (end - start); i++) { ndlp = TAILQ_NEXT(dlp, l_list); TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); dlp = ndlp; } ! dlp = TAILQ_PREV(dlp, rcs_tqh, l_list); } if (op == 'a' || op == 'c') { --- 465,477 ---- if (op == 'c') { + insert_after = TAILQ_PREV(dlp, rcs_tqh, l_list); for (i = 0; i <= (end - start); i++) { ndlp = TAILQ_NEXT(dlp, l_list); TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); dlp = ndlp; } ! dlp = insert_after; } if (op == 'a' || op == 'c') {