Make cmp -s work properly if skip values are given. Also, exit(1)

is now exit(DIFF_EXIT).

PR:		18597
Submitted by:	Anatoly Vorobey <mellon@pobox.com>
Committed at:	Usenix terminal room
This commit is contained in:
Brian Feldman 2000-06-20 20:28:40 +00:00
parent a8cef3390b
commit 84ad3d8fc4

View File

@ -65,9 +65,6 @@ c_regular(fd1, file1, skip1, len1, fd2, file2, skip2, len2)
off_t pagemask, off1, off2; off_t pagemask, off1, off2;
size_t pagesize; size_t pagesize;
if (sflag && len1 != len2)
exit(1);
if (skip1 > len1) if (skip1 > len1)
eofmsg(file1); eofmsg(file1);
len1 -= skip1; len1 -= skip1;
@ -75,6 +72,9 @@ c_regular(fd1, file1, skip1, len1, fd2, file2, skip2, len2)
eofmsg(file2); eofmsg(file2);
len2 -= skip2; len2 -= skip2;
if (sflag && len1 != len2)
exit(DIFF_EXIT);
pagesize = getpagesize(); pagesize = getpagesize();
pagemask = (off_t)pagesize - 1; pagemask = (off_t)pagesize - 1;
off1 = ROUNDPAGE(skip1); off1 = ROUNDPAGE(skip1);