GNU bug report logs - #64485
"diff -y" broken since yesterday

Previous Next

Package: diffutils;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Wed, 5 Jul 2023 17:31:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64485 in the body.
You can then email your comments to 64485 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#64485; Package diffutils. (Wed, 05 Jul 2023 17:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Haible <bruno <at> clisp.org>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Wed, 05 Jul 2023 17:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-diffutils <at> gnu.org
Subject: "diff -y" broken since yesterday
Date: Wed, 05 Jul 2023 19:30:31 +0200
[Message part 1 (text/plain, inline)]
Hi Paul,

I'm trying to understand the meaning of 'in_position' and 'out_position' in
function 'print_half_line'. While doing this, I spotted a bug:

$ cat foo1.txt
a
ab
abc
$ cat foo2.txt
ab
abcd
$ src/diff -t -y foo1.txt foo2.txt
a                                                                <
ab                                                                   ab
abc                                                                |  abcd

This is obviously not how it's intended to be. The attached patch fixes it.
The cause is that in the case of a character of width 1, the assignment

  out_position = in_position;

was lost in commit 05cdf3102ef3fb261db311a3e5d090fb63dbc792 (yesterday).
With this patch, the result is again as it should be:

$ src/diff -t -y foo1.txt foo2.txt
a                                                               <
ab                                                                 ab
abc                                                             |  abcd

The patch also improves comments in this function. So that next time,
I (or anyone else) don't spent 30 minutes to understand the difference
between 'in_position' and 'out_position'.

Bruno


[0001-diff-Fix-diff-y-output.patch (text/x-patch, attachment)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Wed, 05 Jul 2023 17:41:01 GMT) Full text and rfc822 format available.

Notification sent to Bruno Haible <bruno <at> clisp.org>:
bug acknowledged by developer. (Wed, 05 Jul 2023 17:41:02 GMT) Full text and rfc822 format available.

Message #10 received at 64485-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 64485-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#64485: "diff -y" broken since yesterday
Date: Wed, 5 Jul 2023 10:40:26 -0700
Thanks, I installed that.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 03 Aug 2023 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.