Article View: gnu.utils.bug
Article #375bugfix for GNU diff 1.7
From: Juha Sarlin
Date: Wed, 23 Aug 1989 14:49
Date: Wed, 23 Aug 1989 14:49
42 lines
1389 bytes
1389 bytes
GNU diff 1.7 gives incorrect output when comparing files, where the
first file consists of two concatenated copies of the second file.
This script demonstrates the error:
$ cat >file2
aaaa
bbbb
cccc
^D
$ cat file2 file2 >file1
$ diff file1 file2
3d2
< cccc
$ /usr/bin/diff file1 file2
4,6d3
< aaaa
< bbbb
< cccc
And here is my fix:
*** /tmp/,RCSt1a00302 Wed Aug 23 14:45:49 1989
--- io.c Wed Aug 23 14:44:34 1989
***************
*** 374,380 ****
beg0 = filevec[0].prefix_end - 1;
else
beg0 = (filevec[0].prefix_end - 1
! + filevec[1].buffered_chars - filevec[0].buffered_chars);
/* Scan back until chars don't match or we reach that point. */
while (p0 != beg0)
--- 374,380 ----
beg0 = filevec[0].prefix_end - 1;
else
beg0 = (filevec[0].prefix_end - 1
! + filevec[0].buffered_chars - filevec[1].buffered_chars);
/* Scan back until chars don't match or we reach that point. */
while (p0 != beg0)
--
Juha Sarlin juha@tds.kth.se
Technical Details
Message-ID:
<8908231249.AA07835@ttds.tds.kth.se>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!tds.kth.se!juhaShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!tds.kth.se!juha From: juha@tds.kth.se (Juha Sarlin) Newsgroups: gnu.utils.bug Subject: bugfix for GNU diff 1.7 Message-ID: <8908231249.AA07835@ttds.tds.kth.se> Date: 23 Aug 89 14:49:19 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 42