emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#18402: closed (Wrong output for single character f


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18402: closed (Wrong output for single character files without newline)
Date: Wed, 03 Sep 2014 23:07:02 +0000

Your message dated Wed, 03 Sep 2014 16:05:55 -0700
with message-id <address@hidden>
and subject line Re: [bug-diffutils] bug#18402: Wrong output for single 
character files without newline
has caused the debbugs.gnu.org bug report #18402,
regarding Wrong output for single character files without newline
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
18402: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18402
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Re: Wrong output for single character files without newline Date: Wed, 03 Sep 2014 15:03:44 -0600 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0
[adding bug-diffutils, as requested by diff --help]

On 09/03/2014 04:17 AM, Navin Kabra wrote:
> Consider this:
> 
>     echo -n a > /tmp/a
>     echo -n b > /tmp/b
>     diff -B /tmp/a /tmp/b

'echo -n' is non-portable.  Please get used to using 'printf' instead.

> 
> Clearly, the two files are different, yet, diff seems to think that the
> files are identical. I've managed to reproduce this problem on Ubuntu
> 14.04 with diffutils 3.3, on CloudLinux 5.10 with diffutils 2.8.1, and
> also Ubuntu 10.04 with diffutils 2.8.1.
> 
> If I don't use the -B option, the problem goes away. If the files do end
> with a newline, the problem goes away. If the files contain more than 1
> character, the problem goes away. If combined with *some* of the other
> options (e.g. -e or -y) the problem goes away.

Actually, I couldn't reproduce -y making the problem go away:

$ ./src/diff -By <(printf a) <(printf b)
a                                                               b
$ echo $?
0

Thanks for the extensive analysis; I can confirm that this bug is still
present in the latest diffutils.git sources, although I have not
personally hunted for the culprit line of code yet.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message --- Subject: Re: [bug-diffutils] bug#18402: Wrong output for single character files without newline Date: Wed, 03 Sep 2014 16:05:55 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 Thanks for reporting that. I installed the attached 3 patches; patch #2 should fix the bug.

Attachment: 0001-diff-fix-performance-bug-with-prefix-computation.patch
Description: Text document

Attachment: 0002-diff-fix-bug-with-diff-B-and-incomplete-lines.patch
Description: Text document

Attachment: 0003-doc-mention-diff-B-fix-in-NEWS.patch
Description: Text document


--- End Message ---

reply via email to

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