[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23.0.60; diff-apply-hunk new line at end of file

From: Stefan Monnier
Subject: Re: 23.0.60; diff-apply-hunk new line at end of file
Date: Thu, 24 Apr 2008 21:37:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> diff --git a/t.txt b/t.txt
> index f27f040..27bd94f 100644
> --- a/t.txt
> +++ b/t.txt
> @@ -1 +1,2 @@
>  first line.
> +

> (available from: http://www.logic.at/prolog/t.patch )

> and, in the same directory, t.txt with the following content:

> first line.

> (available from: http://www.logic.at/prolog/t.txt )

> and do C-c C-a on the first and only hunk of t.patch, the patch is
> applied. When I then do C-c C-a, another new line is unexpectedly
> inserted at the end of t.txt. Arbitrarily many, if repeated.

Why would that be a bug?  The patch doesn't say that it is at the end of
the file, so all it says is "add an empty line after the line `first
line'".  You may argue that the lack of context is an indication that
it's meant to be at the end-of-file, but that lack of context may be due
to something else.

Furthermore, the same kind of problem can happen even with 3-lines of
context, such that after applying the patch, the new file's content
still contains the pattern required for the patch be applied.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]