NetBSD Problem Report #42619

From www@NetBSD.org  Thu Jan 14 23:45:10 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4C78C63C4FC
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 14 Jan 2010 23:45:10 +0000 (UTC)
Message-Id: <20100114234510.0D9D263C4FB@www.NetBSD.org>
Date: Thu, 14 Jan 2010 23:45:10 +0000 (UTC)
From: pooka@iki.fi
Reply-To: pooka@iki.fi
To: gnats-bugs@NetBSD.org
Subject: patch(1) misfuzzes hunks
X-Send-Pr-Version: www-1.0

>Number:         42619
>Category:       bin
>Synopsis:       patch(1) misfuzzes hunks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    joerg
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 14 23:50:00 +0000 2010
>Last-Modified:  Thu Jan 14 23:51:34 +0000 2010
>Originator:     Antti Kantee
>Release:        5.0
>Organization:
>Environment:
>Description:
> patch < bug.patch 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: puffs_msgif.c
|===================================================================
|RCS file: /cvsroot/src/sys/fs/puffs/puffs_msgif.c,v
|retrieving revision 1.79
|diff -p -u -r1.79 puffs_msgif.c
|--- puffs_msgif.c      7 Jan 2010 23:02:34 -0000       1.79
|+++ puffs_msgif.c      14 Jan 2010 17:54:02 -0000
--------------------------
Patching file puffs_msgif.c using Plan A...
Hunk #1 succeeded at 996 with fuzz 1 (offset 123 lines).
Hunk #2 failed at 1019.
Hunk #3 succeeded at 957 (offset -10 lines).
1 out of 3 hunks failed--saving rejects to puffs_msgif.c.rej
done

The result is in:
http://www.cs.hut.fi/~pooka/NetBSD/patchbug/

Observe that hunk2 is applied in puffs_msgif.c and hunk1 has been "lost".
>How-To-Repeat:
get files from url mentioned above.  Then mv puffs_msgif.c.orig puffs_msgif.c ; patch < bug.patch
>Fix:
pester joerg

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->joerg
Responsible-Changed-By: pooka@NetBSD.org
Responsible-Changed-When: Fri, 15 Jan 2010 01:51:34 +0200
Responsible-Changed-Why:
over to the patch-hugger


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.