Control: tags -1 fixed-upstream
On 2013-07-25 05:14 +0100, Ben Hutchings wrote:
> Package: patch
> Version: 2.7.1-3
> Severity: important
>
> Starting with 'test' containing:
>
> --- BEGIN ---
> 1
> 2
> 3
> 4
> 5
> 6
> --- END ---
>
> and applying the patch:
>
> --- BEGIN ---
> --- test~
> +++ test
> @@ -1,6 +1,7 @@
> 1
> 2
> 3
> +a
> 4
> 5
> 6
> @@ -7,6 +8,7 @@
> 1
> 2
> 3
> +b
> 4
> 5
> 6
> --- END ---
>
> the result is:
>
> --- BEGIN ---
> 1
> 2
> 3
> a
> b
> 4
> 5
> 6
> --- END ---
>
> (with no fuzz, only an offset).
>
> This is clearly wrong. If the insertions were meant to be immediately
> adjacent then they would have been a single hunk. Once one hunk has
> been applied, the context is no longer correct for the second hunk.
This seems to have been fixed in patch 2.7.6 by commit 00947f4111
("Don't allow hunks to overlap")[1], it correctly rejects the second
hunk here.
,----
| $ patch/src/patch -Np1 -i test.diff test
| patching file test
| Hunk #2 FAILED at 8.
| 1 out of 2 hunks FAILED -- saving rejects to file test.rej
`----
Cheers,
Sven
1.
http://git.savannah.gnu.org/cgit/patch.git/commit/?id=00947f4111fbb388852e0626ba7bd1aef5d53cd9