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

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

Re: diff and dos line endings


From: Toshio
Subject: Re: diff and dos line endings
Date: Sat, 09 Apr 2005 12:13:34 -0400

On Sat, 2005-04-09 at 16:53 +0200, Andreas Schwab wrote:
> Toshio <address@hidden> writes:
> 
> > If you do a diff -u --show-c-function test.c.bak test.c with the
> > included files, you'll see that diff -u generates the following line
in
> > its output::
> >   @@ -4,5 +4,5 @@ int tester()^M
> >
> > This line causes problems for patch (GNU version 2.5.4) which
doesn't
> > understand the \r\n at the end of that line.
> 
> I can't reproduce that problem.  Since patch just ignores everything
after
> the second @@ until the next newline I see no way how the CR can cause
any
> problems.
> 
As in you can't get diffutils to produce the output or you can't get
patch to fail?  Fedora Core 3 for my failure cases (patch-2.5.4-20)
(diffutils-2.8.1-12).

I couldn't see why my patch was failing on only one hunk until I
realized that the produced diff had ^M for only one function (The others
were long enough to be truncated.)  Hand editing the ^M out of the patch
allowed the hunk to succeed.

My uneducated guess is that patch is terminating the @@ line at the ^M
instead of the \n... So the line count is off.  Could be totally off
base as I haven't looked at the patch source yet, just diffutils.

-Toshio
-- 
toshio \ "A lasting friendship is one where you never expect anything,
 @tiki  \  always working to make the friendship better.  A good friendship
 -lounge \ is one where the other person does the same."
 .com     \____________________________________________________ GA->ME 1999

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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