[Top][All Lists]

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

Re: diff and dos line endings

From: Eli Zaretskii
Subject: Re: diff and dos line endings
Date: Sat, 09 Apr 2005 18:18:35 +0300

> From: Toshio <address@hidden>
> Date: Fri, 08 Apr 2005 19:54:33 -0400
> While working with quilt on a project which used dos line endings, I
> found a bug with the way diff --show-c-function works.
> 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

What port of Diff is that?  It sounds like a bug in that port: Diff
should never by default output any ^M characters.

> The included diffutils-2.8.1-funclf.patch includes a small change to the
> characters that can stop the detection of functions for the --show-c-
> function that make diff produce output with only a \n at the end of the
> line.

Even if the reason for the patch is accepted as valid, I think the
patch itself is not entirely correct: it should only treat \r
characters like a newline if \n is immediately followed by \n.
Otherwise, you will get bad results for single \r characters in the
middle of a line.

That said, I'm not the official Diffutils maintainer, so please wait
for Paul Eggert to give the definitive response.

reply via email to

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