bug-diffutils
[Top][All Lists]
Advanced

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

Re: [bug-diffutils] [BUG] Incorrect diff output (diff -d is correct)


From: Jean Delvare
Subject: Re: [bug-diffutils] [BUG] Incorrect diff output (diff -d is correct)
Date: Fri, 1 Oct 2010 16:55:32 +0200

Hi Paul,

Thanks for your fast answer.

On Thu, 30 Sep 2010 09:53:21 -0700, Paul Eggert wrote:
> On 09/29/10 09:45, Jean Delvare wrote:
> 
> > This confirms my impression that this is a real bug and not a
> > limitation of the diff'ing algorithm.
> 
> Thanks for the bug report.  It's definitely a bug, though I
> haven't had time to look at the details.  Is this something
> that you can fix?

Unlikely, sorry, given my tight schedule and my total lack of knowledge
of the GNU diff code, which I imagine can be quite complex.

>  (Hint: if in src/analyze.c you comment out
> the body of shift_boundaries, so that shift_boundaries turns
> into a no-op, then the bug goes away.)

This is very interesting, but maybe not completely correct. If I skip
the call to shift_boundaries(), the following two lines:

        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                return -ENODEV;

are still removed and re-added later. The only differences are the
order in which the operations happen, and the fact that the removal and
addition don't sit next to each other in the output. So I wouldn't call
shift_boundaries() broken. Instead, my feeling is that, after
shift_boundaries's work, an extra cleanup step could be taken to
simplify the output.

This can only be considered a bug in shift_boundaries() if this
function is already supposed to perform that cleanup (which would make
some sense, as obviously such cleanups only need to be attempted at
the boundaries which were just touched.) I don't know if this is the
case.

Thanks,
-- 
Jean Delvare



reply via email to

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