[comp.os.minix] cdiff 1.1 patch #1

lwall@sdcrdcf.UUCP (06/03/87)

System: cdiff version 1.1
Patch #: 1
Priority: HIGH
Subject: Overlapping hunks may not be concatenated properly
From: aeusemrs@csun.UUCP (Mike Stump)

Description:
	If the context of a hunk overlaps with a previous hunk, under
	certain circumstances (more appends than deletions) the hunk
	which should have been concatenated with the precious hunk is
	treated as a separate hunk.  Unfortunately, since the input
	files have already been read past that point, null or misleading
	hunks result.

Fix:	From rn, say "| patch -d DIR", where DIR is your cdiff source
	directory.  Outside of rn, say "cd DIR; patch <thisarticle".
	If you don't have the patch program, apply the following by hand,
	or get patch.

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel.h file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

Index: patchlevel.h
Prereq: 0
1c1
< #define PATCHLEVEL 0
---
> #define PATCHLEVEL 1
 
Index: cdiff.c
Prereq: 1.1
*** cdiff.c.old	Wed Jun  3 11:53:27 1987
*** cdiff.c	Wed Jun  3 11:53:30 1987
***************
*** 1,4
! static char rcsid[] = "$Header: cdiff.c,v 1.1 87/06/01 16:05:57 lwall Exp $";
  
  /* cdiff - turns a regular diff into a new-style context diff
   *

--- 1,4 -----
! 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
   *
***************
*** 5,10
   * Usage: cdiff file1 file2
   *
   * $Log:	cdiff.c,v $
   * Revision 1.1  87/06/01  16:05:57  lwall
   * Initial revision
   * 

--- 5,13 -----
   * 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.
+  * 
   * Revision 1.1  87/06/01  16:05:57  lwall
   * Initial revision
   * 
***************
*** 151,157
  	    newbeg = newmin - context;
  	    newend = newmax + context;
  
! 	    if (preoldend < newbeg - 1) {
  		if (preoldend >= 0) {
  		    dumphunk();
  		}

--- 154,160 -----
  	    newbeg = newmin - context;
  	    newend = newmax + context;
  
! 	    if (preoldend < oldbeg - 1) {
  		if (preoldend >= 0) {
  		    dumphunk();
  		}