GNU bug report logs - #20929
problem with diff -B and incomplete lines

Previous Next

Package: diffutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 29 Jun 2015 16:59:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

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 20929 in the body.
You can then email your comments to 20929 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#20929; Package diffutils. (Mon, 29 Jun 2015 16:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Mon, 29 Jun 2015 16:59:03 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Diffutils bugs <bug-diffutils <at> gnu.org>, 
 Ricardo Anido <ranido <at> ic.unicamp.br>
Subject: problem with diff -B and incomplete lines
Date: Mon, 29 Jun 2015 09:58:42 -0700
Thanks for the bug report.  I'm forwarding this to bug-diffutils so that it gets 
a proper bug number.

-------- Forwarded Message --------
Subject: Bug in diff
Date: Mon, 29 Jun 2015 16:00:48 +0100
From: Ricardo Anido <ranido <at> ic.unicamp.br>
To: bug-gnu-utils <at> gnu.org

If the last line of a file has a sole character and no '\n', using the flag
-B makes diff miss the difference between files. The difference is
correctly reported using flags -b or -w. Better explained by an example,
below. Notice that the last line of tmp2 has only the character 'X':

--------------------

ranido <at> ubuntu:~$ cat tmp1

a

b

c

ranido <at> ubuntu:~$ cat tmp2

a

b

c

Xranido <at> ubuntu:~$ od -cx tmp1

0000000   a  \n   b  \n   c  \n

           0a61    0a62    0a63

0000006

ranido <at> ubuntu:~$ od -cx tmp2

0000000   a  \n   b  \n   c  \n   X

           0a61    0a62    0a63    0058

0000007

ranido <at> ubuntu:~$ diff -B tmp1 tmp2

ranido <at> ubuntu:~$ diff -b tmp1 tmp2

3a4

> X

\ No newline at end of file
ranido <at> ubuntu:~$
--------------------

Best regards, thanks for the amazing work on gnu!

---
Ricardo Anido
IC-UNICAMP
Av. Albert Einstein, 1251
13083-852 Campinas SP
Tel. (19) 3521 5863    Fax. (19) 3521 5847






Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Sun, 01 May 2016 02:12:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Sun, 01 May 2016 02:12:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: 20929-done <at> debbugs.gnu.org
Subject: Re: problem with diff -B and incomplete lines
Date: Sat, 30 Apr 2016 19:11:15 -0700
Thanks for the report.
That was fixed by this change:

   http://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=v3.3-24-gd2fd9d4

That will be included in the upcoming diffutils-3.4




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 May 2016 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 84 days ago.

Previous Next


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