bin/84816: patch(1) inserts a line in the wrong place
Bram at moolenaar.net
Thu Aug 11 20:20:17 GMT 2005
>Synopsis: patch(1) inserts a line in the wrong place
>Arrival-Date: Thu Aug 11 20:20:16 GMT 2005
>Originator: Bram Moolenaar
>Release: FreeBSD 5.3-RELEASE i386
System: FreeBSD masaka.moolenaar.net 5.3-RELEASE FreeBSD 5.3-RELEASE #12: Wed Mar 2 20:26:40 CET 2005 mool at masaka.moolenaar.net:/usr/src/sys/i386/compile/MASAKA i386
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".
Example original file:
Example of the patched file as it should end up:
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 ----
The resulting patched file:
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.
More information about the freebsd-bugs