[Top][All Lists]

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

Re: [bug-patch] Bug in patch?

From: Andreas Gruenbacher
Subject: Re: [bug-patch] Bug in patch?
Date: Mon, 28 Dec 2009 15:21:53 +0100
User-agent: KMail/1.12.2 (Linux/; KDE/4.3.1; i686; ; )

Hello David,

thanks for the bug report.

On Sunday 20 December 2009 13:00:49 David VANTYGHEM wrote:
> Hello,
> I'm using patch 2.5.9 on Mandriva Linux. I've got the following bug :
> bash-4.0$ diff config.js.old config.js.new >config.js.diff
> -> OK
> bash-4.0$ patch config.js.old config.js.diff 
> (Stripping trailing CRs from patch.)
> patching file config.js.old
> Hunk #1 FAILED at 9.
> 1 out of 1 hunk FAILED -- saving rejects to file config.js.old.rej
> -> I can't apply the patch file on the original config.js.old file.

The old and new files are both with CRLF line endings, and the diff ends up 

        $ cat -v config.js.diff
        <       // config.language = 'fr';^M
        >       config.language = 'fr';^M

From that, patch wrongly assumes that the entire patch has been CRLF mangled 
and strips off all CRs.  This only happens with normal style diffs; the other 
types of patches are not affected.

I have added a fix to the git repository 
(git://git.savannah.gnu.org/patch.git), and I'll put another snapshot here 
later today:



reply via email to

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