Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/cmp/link.c
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | for (p1 = buf1 + skip1, p2 = buf2 + skip2; | ||||
*p1 && *p2 && (limit == 0 || byte <= limit); p1++, p2++) { | *p1 && *p2 && (limit == 0 || byte <= limit); p1++, p2++) { | ||||
if ((ch = *p1) != *p2) { | if ((ch = *p1) != *p2) { | ||||
if (xflag) { | if (xflag) { | ||||
dfound = 1; | dfound = 1; | ||||
(void)printf("%08llx %02x %02x\n", | (void)printf("%08llx %02x %02x\n", | ||||
(long long)byte - 1, ch, *p2); | (long long)byte - 1, ch, *p2); | ||||
} else if (lflag) { | } else if (lflag) { | ||||
dfound = 1; | dfound = 1; | ||||
if (bflag) | |||||
(void)printf("%6lld %3o %c %3o %c\n", | |||||
(long long)byte, ch, ch, *p2, *p2); | |||||
else | |||||
(void)printf("%6lld %3o %3o\n", | (void)printf("%6lld %3o %3o\n", | ||||
(long long)byte, ch, *p2); | (long long)byte, ch, *p2); | ||||
} else | } else | ||||
diffmsg(file1, file2, byte, 1); | diffmsg(file1, file2, byte, 1, ch, *p2); | ||||
/* NOTREACHED */ | /* NOTREACHED */ | ||||
} | } | ||||
byte++; | byte++; | ||||
} | } | ||||
if (*p1 || *p2) | if (*p1 || *p2) | ||||
eofmsg (*p1 ? file2 : file1); | eofmsg (*p1 ? file2 : file1); | ||||
if (dfound) | if (dfound) | ||||
exit(DIFF_EXIT); | exit(DIFF_EXIT); | ||||
} | } |