Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ucla-cs!sdcrdcf!lwall From: lwall@sdcrdcf.UUCP Newsgroups: net.sources.bugs Subject: patch 2.0 patch #5 Message-ID: <4115@sdcrdcf.UUCP> Date: Mon, 9-Feb-87 20:11:34 EST Article-I.D.: sdcrdcf.4115 Posted: Mon Feb 9 20:11:34 1987 Date-Received: Wed, 11-Feb-87 04:45:37 EST Organization: System Development Corporation, Santa Monica Lines: 106 Summary: This is an official patch for patch 2.0. Please apply it. System: patch version 2.0 Patch #: 5 Priority: HIGH Subject: Patch misplaces patches when fuzz factor > 0 Authorial-Remark: OOPS. From: erix!per (Per Hedeland) Description: If a fuzz factor > 0 is used when applying a patch hunk, it will be applied (fuzz factor) lines too far into the file. Fix: Since patch_match starts checking "fuzz" lines into the patch, it must (of course) add "fuzz" to the starting point in the file as well. From rn, say "| patch -d DIR", where DIR is your patch source directory. Outside of rn, say "cd DIR; patch #define PATCHLEVEL 5 Index: patch.c Prereq: 2.0.1.1 *** patch.c.old Fri Nov 21 09:43:33 1986 *** patch.c Fri Nov 21 09:43:42 1986 *************** *** 1,5 char rcsid[] = ! "$Header: patch.c,v 2.0.1.1 86/10/29 13:10:22 lwall Exp $"; /* patch - a program to apply diffs to original files * --- 1,5 ----- char rcsid[] = ! "$Header: patch.c,v 2.0.1.2 86/11/21 09:39:15 lwall Exp $"; /* patch - a program to apply diffs to original files * *************** *** 9,14 * money off of it, or pretend that you wrote it. * * $Log: patch.c,v $ * Revision 2.0.1.1 86/10/29 13:10:22 lwall * Backwards search could terminate prematurely. * --- 9,17 ----- * money off of it, or pretend that you wrote it. * * $Log: patch.c,v $ + * Revision 2.0.1.2 86/11/21 09:39:15 lwall + * Fuzz factor caused offset of installed lines. + * * Revision 2.0.1.1 86/10/29 13:10:22 lwall * Backwards search could terminate prematurely. * *************** *** 785,791 Reg2 LINENUM iline; Reg3 LINENUM pat_lines = pch_ptrn_lines() - fuzz; ! for (iline=base+offset; pline <= pat_lines; pline++,iline++) { if (canonicalize) { if (!similar(ifetch(iline, (offset >= 0)), pfetch(pline), --- 788,794 ----- Reg2 LINENUM iline; Reg3 LINENUM pat_lines = pch_ptrn_lines() - fuzz; ! for (iline=base+offset+fuzz; pline <= pat_lines; pline++,iline++) { if (canonicalize) { if (!similar(ifetch(iline, (offset >= 0)), pfetch(pline),