Article 5C841 Confirming a DIFF bug

Confirming a DIFF bug

by
joejobs
from LinuxQuestions.org on (#5C841)
Hello,

I think I found a bug in DIFF last version (2.8.7) - I'm using it on Windows (from gnuwin32) and I would like to share it in order to make sure it is indeed a bug and I am not making a mistake

Download "a.txt" from here - https://pastebin.com/MPvv83wi
Download "b.txt" from here - https://pastebin.com/QhzufK6E

Then use this command:
diff a.txt b.txt | grep "14:53"

the result is
< |date=12 July |time=14:53:36
> |date=12 July |time=14:53:36

and this result is wrong. The output should be empty instead.
If you delete the first line in the file "a.txt" (which does not contain the string "14:53"), then the result is correct - nothing in the output

Another way to check the bug is this:

diff a.txt b.txt | grep "<" | cut -c3- > c.txt
diff a.txt c.txt | grep "<" | cut -c3- > d.txt

The file d.txt should be the same with b.txt

but it is not.
However, if you delete the first line in a.txt, the result is correct

The original "a.txt" file was much bigger when I found this bug, I tried to make it as small as possible but I can't make it shorter than it's current size.

I used DIFF on Windows for many years and it worked very well, never had any problem. This is the first time when it acts weird for me.

Can anyone confirm this bug?

Thankslatest?d=yIl2AUoC8zA latest?i=WojaMhnWF0g:nB6F3JoR-Zg:F7zBnMy latest?i=WojaMhnWF0g:nB6F3JoR-Zg:V_sGLiP latest?d=qj6IDK7rITs latest?i=WojaMhnWF0g:nB6F3JoR-Zg:gIN9vFwWojaMhnWF0g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments