version 1.3, 1996/08/01 00:01:38 |
version 1.4, 1996/08/01 00:29:10 |
|
|
} |
} |
if (strcmp(file2 = argv[1], "-") == 0) { |
if (strcmp(file2 = argv[1], "-") == 0) { |
if (special) |
if (special) |
errx(ERR_EXIT, |
if (sflag) |
"standard input may only be specified once"); |
exit(ERR_EXIT); |
|
else |
|
errx(ERR_EXIT, |
|
"standard input may only be specified once"); |
special = 1; |
special = 1; |
fd2 = 0; |
fd2 = 0; |
file2 = "stdin"; |
file2 = "stdin"; |
} |
} |
else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) |
else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) |
err(ERR_EXIT, "%s", file2); |
if (sflag) |
|
exit(ERR_EXIT); |
|
else |
|
err(ERR_EXIT, "%s", file2); |
|
|
skip1 = argc > 2 ? strtoq(argv[2], NULL, 10) : 0; |
skip1 = argc > 2 ? strtoq(argv[2], NULL, 10) : 0; |
skip2 = argc == 4 ? strtoq(argv[3], NULL, 10) : 0; |
skip2 = argc == 4 ? strtoq(argv[3], NULL, 10) : 0; |
|
|
if (!special) { |
if (!special) { |
if (fstat(fd1, &sb1)) |
if (fstat(fd1, &sb1)) |
err(ERR_EXIT, "%s", file1); |
if (sflag) |
|
exit(ERR_EXIT); |
|
else |
|
err(ERR_EXIT, "%s", file1); |
if (!S_ISREG(sb1.st_mode)) |
if (!S_ISREG(sb1.st_mode)) |
special = 1; |
special = 1; |
else { |
else { |
if (fstat(fd2, &sb2)) |
if (fstat(fd2, &sb2)) |
err(ERR_EXIT, "%s", file2); |
if (sflag) |
|
exit(ERR_EXIT); |
|
else |
|
err(ERR_EXIT, "%s", file2); |
if (!S_ISREG(sb2.st_mode)) |
if (!S_ISREG(sb2.st_mode)) |
special = 1; |
special = 1; |
} |
} |