bug-gnu-utils
[Top][All Lists]
Advanced

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

diff/patch incompatibility with -p and crlf


From: Egmont Koblinger
Subject: diff/patch incompatibility with -p and crlf
Date: Tue, 6 Sep 2005 19:00:20 +0200
User-agent: Mutt/1.5.6+20040722i

Hi,

I found a strange incompatibility between diffutils 2.8.1 and patch 2.5.4.
There's a special case when a patch generated by "diff" cannot be applied by
"patch".

If the file to be patched has DOS-style CR-LF newlines, and the "-p" option
of diff is being used, then in the generated patch the "@@" lines will also
end with CR-LF since a function name (a line of the source code which ends
in a CR-LF) is copied there.

When trying to apply such a patch, the patch utility, seeing that the "@@"
line also ends in CR-LF, believes that the file should not contain CR's
(maybe it was incorrectly transferred through ASCII FTP or similar channel)
and automatically strips all the CR's from the file. And then applying the
result will fail since important CR's are missing from the end of subsequent
lines.

I believe that "diff" is buggy, it should make sure not to put CR at the end
of the "@@" lines.



thx,

Egmont




reply via email to

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