[net.sources.bugs] patch bug #1

lwall@sdcrdcf.UUCP (Larry Wall) (12/04/84)

System: patch version 1.2
Bug #: 1
Priority: LOW
Subject: inaccurate failed count for multiple patches
From: yale!kaufman
Index: patch.c
Prereq: 1.2

Description:
	If there are multiple patches in one file, and patch fails on a
	a hunk in one patch, it will generate bogus failed counts for all
	following patches in the same file.

Fix:    Reset failed, as per below.

	From rn, say "| patch -d DIR", where DIR is your patch source
	directory.  Outside of rn, say "cd DIR; patch <thisarticle".

***************
*** 1,6
  /* patch - a program to apply diffs to original files
   *
!  * $Header: patch.c,v 1.2 84/11/29 13:29:51 lwall Exp $
   *
   * Copyright 1984, Larry Wall
   *

--- 1,6 -----
  /* patch - a program to apply diffs to original files
   *
!  * $Header: patch.c,v 1.2.1.2 84/12/04 09:47:13 lwall Exp $
   *
   * Copyright 1984, Larry Wall
   *
***************
*** 8,13
   * money off of it, or pretend that you wrote it.
   *
   * $Log:	patch.c,v $
   * Revision 1.2  84/11/29  13:29:51  lwall
   * Linted.  Identifiers uniqified.  Fixed i_ptr malloc() bug.  Fixed
   * multiple calls to mktemp().  Will now work on machines that can only

--- 8,19 -----
   * money off of it, or pretend that you wrote it.
   *
   * $Log:	patch.c,v $
+  * Revision 1.2.1.2  84/12/04  09:47:13  lwall
+  * Failed hunk count not reset on multiple patch file.
+  * 
+  * Revision 1.2.1.1  84/12/04  09:42:37  lwall
+  * Branch for sdcrdcf changes.
+  * 
   * Revision 1.2  84/11/29  13:29:51  lwall
   * Linted.  Identifiers uniqified.  Fixed i_ptr malloc() bug.  Fixed
   * multiple calls to mktemp().  Will now work on machines that can only
***************
*** 212,217
      
  	/* apply each hunk of patch */
  	hunk = 0;
  	while (another_hunk()) {
  	    hunk++;
  	    where = locate_hunk();

--- 218,224 -----
      
  	/* apply each hunk of patch */
  	hunk = 0;
+ 	failed = 0;
  	while (another_hunk()) {
  	    hunk++;
  	    where = locate_hunk();