Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!lwall From: lwall@sdcrdcf.UUCP (Larry Wall) Newsgroups: net.sources.bugs Subject: patch 2.0 patch #3 Message-ID: <3400@sdcrdcf.UUCP> Date: Mon, 3-Nov-86 21:06:24 EST Article-I.D.: sdcrdcf.3400 Posted: Mon Nov 3 21:06:24 1986 Date-Received: Tue, 4-Nov-86 08:02:11 EST Organization: System Development Corporation, Santa Monica Lines: 102 Summary: This is an official patch for patch 2.0. Please apply it. System: patch version 2.0 Patch #: 3 Priority: HIGH Subject: new-style diff with deletion can trigger spurious assertion failure From: cope.ucsf.edu!goldman (Eric Goldman) Description: A 4.3-style context diff that does deletions can cause patch to die of an assertion failure. Interestingly enough, if the assertion weren't there patch would work fine. Repeat-By: Easy. Try applying a new-style context diff with deletions. Fix: From rn, say "| patch -d DIR", where DIR is your patch source directory. Outside of rn, say "cd DIR; patch #define PATCHLEVEL 3 Index: pch.c Prereq: 2.0.1.1 *** pch.c.old Mon Nov 3 17:53:21 1986 *** pch.c Mon Nov 3 17:53:54 1986 *************** *** 1,4 ! /* $Header: pch.c,v 2.0.1.1 86/10/29 15:52:08 lwall Exp $ * * $Log: pch.c,v $ * Revision 2.0.1.1 86/10/29 15:52:08 lwall --- 1,4 ----- ! /* $Header: pch.c,v 2.0.1.2 86/11/03 17:49:52 lwall Exp $ * * $Log: pch.c,v $ * Revision 2.0.1.2 86/11/03 17:49:52 lwall *************** *** 1,6 /* $Header: pch.c,v 2.0.1.1 86/10/29 15:52:08 lwall Exp $ * * $Log: pch.c,v $ * Revision 2.0.1.1 86/10/29 15:52:08 lwall * Could falsely report new-style context diff. * --- 1,9 ----- /* $Header: pch.c,v 2.0.1.2 86/11/03 17:49:52 lwall Exp $ * * $Log: pch.c,v $ + * Revision 2.0.1.2 86/11/03 17:49:52 lwall + * New-style delete triggers spurious assertion error. + * * Revision 2.0.1.1 86/10/29 15:52:08 lwall * Could falsely report new-style context diff. * *************** *** 629,635 p_len[filldst] = p_len[fillsrc]; fillsrc++; filldst++; } ! while (fillsrc <= p_end && p_char[fillsrc] != ' ') fillsrc++; #ifdef DEBUGGING if (debug & 64) --- 632,639 ----- p_len[filldst] = p_len[fillsrc]; fillsrc++; filldst++; } ! while (fillsrc <= p_end && fillsrc != repl_beginning && ! p_char[fillsrc] != ' ') fillsrc++; #ifdef DEBUGGING if (debug & 64)