static char sccsid
[] = "@(#)diff.c 4.1 10/9/80";
* diff - driver and subroutines
ifdef1
= "FILE1"; ifdef2
= "FILE2";
while (argc
> 2 && argv
[0][0] == '-') {
while (*argp
) switch(*argp
++) {
/* -Dfoo = -E -1 -2foo */
"diff: -c: bad count\n");
fprintf(stderr
, "diff: use -Sstart\n");
*--argp
= 0; /* don't pass it on */
fprintf(stderr
, "diff: -%s: unknown option\n",
fprintf(stderr
, "diff: two filename arguments required\n");
"diff: -h doesn't support -e, -f, -n, -c, or -I\n");
else if (stat(file1
, &stb1
) < 0) {
fprintf(stderr
, "diff: ");
else if (stat(file2
, &stb2
) < 0) {
fprintf(stderr
, "diff: ");
if ((stb1
.st_mode
& S_IFMT
) == S_IFDIR
&&
(stb2
.st_mode
& S_IFMT
) == S_IFDIR
) {
register char *dp
= malloc(strlen(cp
)+1);
fprintf(stderr
, "diff: ran out of memory\n");
ralloc(p
,n
) /*compacting reallocation */
q
= realloc(p
, (unsigned)n
);
fprintf(stderr
, "diff: files too big, try -h\n");