Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!cit-vax!oberon!sdcrdcf!lwall From: lwall@sdcrdcf.UUCP (Larry Wall) Newsgroups: comp.os.minix Subject: cdiff 1.1 patch #2 Message-ID: <4669@sdcrdcf.UUCP> Date: Thu, 4-Jun-87 19:04:23 EDT Article-I.D.: sdcrdcf.4669 Posted: Thu Jun 4 19:04:23 1987 Date-Received: Tue, 9-Jun-87 02:18:06 EDT Organization: Unisys - System Development Group, Santa Monica Lines: 92 Summary: This is an official patch for cdiff 1.1. Please apply it. System: cdiff version 1.1 Patch #: 2 Priority: HIGH Subject: won't make diffs with less than 3 lines of leading context right From: lwall@sdcrdcf.UUCP (Larry Wall) Description: If there is a difference close enough to the beginning of the file to require less than three lines of context, cdiff bombs out. Repeat-By: How about, run cdiff on the patch level 0 cdiff vs the patch level 1 cdiff. Sigh. Fix: From rn, say "| patch -d DIR", where DIR is your cdiff source directory. Outside of rn, say "cd DIR; patch #define PATCHLEVEL 2 Index: cdiff.c Prereq: 1.1.1.1 *** cdiff.c.old Thu Jun 4 11:22:37 1987 *** cdiff.c Thu Jun 4 11:22:40 1987 *************** *** 1,10 **** ! static char rcsid[] = "$Header: cdiff.c,v 1.1.1.1 87/06/03 11:52:25 lwall Exp $"; /* cdiff - turns a regular diff into a new-style context diff * * Usage: cdiff file1 file2 * * $Log: cdiff.c,v $ * Revision 1.1.1.1 87/06/03 11:52:25 lwall * Wasn't concatenating overlapping hunks right. * --- 1,13 ---- ! static char rcsid[] = "$Header: cdiff.c,v 1.1.1.2 87/06/04 11:21:43 lwall Exp $"; /* cdiff - turns a regular diff into a new-style context diff * * Usage: cdiff file1 file2 * * $Log: cdiff.c,v $ + * Revision 1.1.1.2 87/06/04 11:21:43 lwall + * Didn't do diffs with less than 3 lines of leading context. + * * Revision 1.1.1.1 87/06/03 11:52:25 lwall * Wasn't concatenating overlapping hunks right. * *************** *** 151,158 **** --- 154,165 ---- oldbeg = oldmin - context; oldend = oldmax + context; + if (oldbeg < 1) + oldbeg = 1; newbeg = newmin - context; newend = newmax + context; + if (newbeg < 1) + newbeg = 1; if (preoldend < oldbeg - 1) { if (preoldend >= 0) {