=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cmp/cmp.c,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** src/usr.bin/cmp/cmp.c 1996/08/01 00:01:38 1.3 --- src/usr.bin/cmp/cmp.c 1996/08/01 00:29:10 1.4 *************** *** 1,4 **** ! /* $OpenBSD: cmp.c,v 1.3 1996/08/01 00:01:38 michaels Exp $ */ /* $NetBSD: cmp.c,v 1.7 1995/09/08 03:22:56 tls Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: cmp.c,v 1.4 1996/08/01 00:29:10 michaels Exp $ */ /* $NetBSD: cmp.c,v 1.7 1995/09/08 03:22:56 tls Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94"; #else ! static char rcsid[] = "$OpenBSD: cmp.c,v 1.3 1996/08/01 00:01:38 michaels Exp $"; #endif #endif /* not lint */ --- 44,50 ---- #if 0 static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94"; #else ! static char rcsid[] = "$OpenBSD: cmp.c,v 1.4 1996/08/01 00:29:10 michaels Exp $"; #endif #endif /* not lint */ *************** *** 114,139 **** } if (strcmp(file2 = argv[1], "-") == 0) { if (special) ! errx(ERR_EXIT, ! "standard input may only be specified once"); special = 1; fd2 = 0; file2 = "stdin"; } else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) ! err(ERR_EXIT, "%s", file2); skip1 = argc > 2 ? strtoq(argv[2], NULL, 10) : 0; skip2 = argc == 4 ? strtoq(argv[3], NULL, 10) : 0; if (!special) { if (fstat(fd1, &sb1)) ! err(ERR_EXIT, "%s", file1); if (!S_ISREG(sb1.st_mode)) special = 1; else { if (fstat(fd2, &sb2)) ! err(ERR_EXIT, "%s", file2); if (!S_ISREG(sb2.st_mode)) special = 1; } --- 114,151 ---- } if (strcmp(file2 = argv[1], "-") == 0) { if (special) ! if (sflag) ! exit(ERR_EXIT); ! else ! errx(ERR_EXIT, ! "standard input may only be specified once"); special = 1; fd2 = 0; file2 = "stdin"; } else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) ! if (sflag) ! exit(ERR_EXIT); ! else ! err(ERR_EXIT, "%s", file2); skip1 = argc > 2 ? strtoq(argv[2], NULL, 10) : 0; skip2 = argc == 4 ? strtoq(argv[3], NULL, 10) : 0; if (!special) { if (fstat(fd1, &sb1)) ! if (sflag) ! exit(ERR_EXIT); ! else ! err(ERR_EXIT, "%s", file1); if (!S_ISREG(sb1.st_mode)) special = 1; else { if (fstat(fd2, &sb2)) ! if (sflag) ! exit(ERR_EXIT); ! else ! err(ERR_EXIT, "%s", file2); if (!S_ISREG(sb2.st_mode)) special = 1; }