bug-gnu-utils
[Top][All Lists]
Advanced

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

Wrong output for single character files without newline


From: Navin Kabra
Subject: Wrong output for single character files without newline
Date: Wed, 03 Sep 2014 15:47:59 +0530
User-agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)

Consider this:

    echo -n a > /tmp/a
    echo -n b > /tmp/b
    diff -B /tmp/a /tmp/b

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.





reply via email to

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