Article View: net.sources.bugs
Article #848patch 2.0 patch #1
From: Larry Wall
Date: Wed, 29 Oct 1986 23:24
Date: Wed, 29 Oct 1986 23:24
85 lines
3167 bytes
3167 bytes
System: patch version 2.0
Patch #: 1
Priority: MEDIUM
Subject: Backwards scan for place to insert hunk can give up prematurely
From: dorab@ucla-cs.uucp (Dorab Patel)
Description:
Under certain circumstances patch can fail to find the correct
location to install a hunk. If the proper place to insert a hunk
is more lines backwards than the number of lines left in the input
file from the place it first starts searching from, patch gives up
because of a more-or-less typographical error.
Fix: From rn, say "| patch -d DIR", where DIR is your patch 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: patch.c
Prereq: 2.0
*** patch.c.old Wed Oct 29 13:50:40 1986
*** patch.c Wed Oct 29 13:50:45 1986
***************
*** 1,5
char rcsid[] =
! "$Header: patch.c,v 2.0 86/09/17 15:37:32 lwall Exp $";
/* patch - a program to apply diffs to original files
*
--- 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
*
***************
*** 9,14
* money off of it, or pretend that you wrote it.
*
* $Log: patch.c,v $
* Revision 2.0 86/09/17 15:37:32 lwall
* Baseline for netwide release.
*
--- 9,17 -----
* 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.
+ *
* Revision 2.0 86/09/17 15:37:32 lwall
* Baseline for netwide release.
*
***************
*** 454,460
return first_guess;
for (offset = 1; ; offset++) {
Reg5 bool check_after = (offset <= max_pos_offset);
! Reg6 bool check_before = (offset <= max_pos_offset);
if (check_after && patch_match(first_guess, offset, fuzz)) {
#ifdef DEBUGGING
--- 457,463 -----
return first_guess;
for (offset = 1; ; offset++) {
Reg5 bool check_after = (offset <= max_pos_offset);
! Reg6 bool check_before = (offset <= max_neg_offset);
if (check_after && patch_match(first_guess, offset, fuzz)) {
#ifdef DEBUGGING
Technical Details
Message-ID:
<3385@sdcrdcf.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!rutgers!cbmvax!bpa!burdvax!sdcrdcf!lwallShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!rutgers!cbmvax!bpa!burdvax!sdcrdcf!lwall From: lwall@sdcrdcf.UUCP (Larry Wall) Newsgroups: net.sources.bugs Subject: patch 2.0 patch #1 Message-ID: <3385@sdcrdcf.UUCP> Date: Wed, 29-Oct-86 18:24:18 EST Article-I.D.: sdcrdcf.3385 Posted: Wed Oct 29 18:24:18 1986 Date-Received: Fri, 31-Oct-86 02:00:02 EST Organization: System Development Corporation, Santa Monica Lines: 85 Summary: This is an official patch for patch 2.0. Please apply it.