From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 11 20:20:17 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A71FE16A41F for ; Thu, 11 Aug 2005 20:20:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9347143D55 for ; Thu, 11 Aug 2005 20:20:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j7BKKGgX068917 for ; Thu, 11 Aug 2005 20:20:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j7BKKGRM068916; Thu, 11 Aug 2005 20:20:16 GMT (envelope-from gnats) Resent-Date: Thu, 11 Aug 2005 20:20:16 GMT Resent-Message-Id: <200508112020.j7BKKGRM068916@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bram Moolenaar Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2038D16A41F for ; Thu, 11 Aug 2005 20:14:40 +0000 (GMT) (envelope-from Bram@moolenaar.net) Received: from post-25.mail.nl.demon.net (post-25.mail.nl.demon.net [194.159.73.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF81143D45 for ; Thu, 11 Aug 2005 20:14:39 +0000 (GMT) (envelope-from Bram@moolenaar.net) Received: from zimbu.demon.nl ([82.161.100.193]:51323 helo=moolenaar.net) by post-25.mail.nl.demon.net with esmtp (Exim 4.51) id 1E3JRm-0005au-Bn for FreeBSD-gnats-submit@freebsd.org; Thu, 11 Aug 2005 20:14:38 +0000 Received: from masaka.moolenaar.net (localhost.moolenaar.net [127.0.0.1]) by moolenaar.net (8.13.1/8.13.1) with ESMTP id j7BHm8gc037514 for ; Thu, 11 Aug 2005 19:48:08 +0200 (CEST) (envelope-from Bram@moolenaar.net) Received: (from mool@localhost) by masaka.moolenaar.net (8.13.1/8.13.1/Submit) id j7BHm8x0037513; Thu, 11 Aug 2005 19:48:08 +0200 (CEST) (envelope-from mool) Message-Id: <200508111748.j7BHm8x0037513@masaka.moolenaar.net> Date: Thu, 11 Aug 2005 19:48:08 +0200 (CEST) From: Bram Moolenaar To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/84816: patch(1) inserts a line in the wrong place X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bram Moolenaar List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2005 20:20:17 -0000 >Number: 84816 >Category: bin >Synopsis: patch(1) inserts a line in the wrong place >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 11 20:20:16 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Bram Moolenaar >Release: FreeBSD 5.3-RELEASE i386 >Organization: Zimbu Labs >Environment: System: FreeBSD masaka.moolenaar.net 5.3-RELEASE FreeBSD 5.3-RELEASE #12: Wed Mar 2 20:26:40 CET 2005 mool@masaka.moolenaar.net:/usr/src/sys/i386/compile/MASAKA i386 >Description: When patching a file, where the change is that one line is inserted at the start of the file, the new line ends up as the second line instead. This only appears to happen when the diff file was generated with a context of one line "diff -C 1". >How-To-Repeat: Example original file: asdf 1 asdf 2 Example of the patched file as it should end up: 999999 asdf 1 asdf 2 The diff file used, generated with "diff -C 1" *** try.orig Thu Aug 11 19:33:39 2005 --- try Thu Aug 11 19:33:53 2005 *************** *** 1 **** --- 1,2 ---- + 999999 asdf 1 The resulting patched file: asdf 1 999999 asdf 2 >Fix: Unknown. I tried changing the "1" in the diff file to "1,1", but that didn't help. The contents of the file doesn't seem to matter. When using a different number of context lines the bug does not appear. >Release-Note: >Audit-Trail: >Unformatted: