diff options
| author | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
|---|---|---|
| committer | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
| commit | a16f65c7d117419bd266c28a1901ef129a337569 (patch) | |
| tree | 2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /usr.bin/cmp | |
| parent | 8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff) | |
Release FreeBSD 1.1upstream/1.1.0_cvsrelease/1.1.0_cvs
This commit was manufactured to restore the state of the 1.1-RELEASE image.
Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'usr.bin/cmp')
| -rw-r--r-- | usr.bin/cmp/cmp.1 | 6 | ||||
| -rw-r--r-- | usr.bin/cmp/cmp.c | 25 |
2 files changed, 13 insertions, 18 deletions
diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1 index ab003e1c37b6..cf64dfd48920 100644 --- a/usr.bin/cmp/cmp.1 +++ b/usr.bin/cmp/cmp.1 @@ -32,7 +32,8 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)cmp.1 6.7 (Berkeley) 6/27/91 +.\" from: @(#)cmp.1 6.7 (Berkeley) 6/27/91 +.\" $Id: cmp.1,v 1.2 1993/11/23 00:17:16 jtc Exp $ .\" .Dd June 27, 1991 .Dt CMP 1 @@ -95,4 +96,5 @@ An error occurred. .Sh STANDARDS The .Nm cmp -function is expected to be POSIX 1003.2 compatible. +utility conforms to +.St -p1003.2-92 . diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index c512819bef49..6ef2d70a8173 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -38,7 +38,8 @@ char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)cmp.c 5.3 (Berkeley) 6/1/90"; +/*static char sccsid[] = "from: @(#)cmp.c 5.3 (Berkeley) 6/1/90";*/ +static char rcsid[] = "$Id: cmp.c,v 1.2 1993/11/23 00:17:17 jtc Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -58,14 +59,14 @@ char *file1, *file2; main(argc, argv) int argc; - char *argv[]; + char **argv; { extern char *optarg; extern int optind; int ch; u_long otoi(); - while ((ch = getopt(argc, argv, "-ls")) != EOF) + while ((ch = getopt(argc, argv, "ls")) != -1) switch (ch) { case 'l': /* print all differences */ all = 1; @@ -73,25 +74,19 @@ main(argc, argv) case 's': /* silent run */ silent = 1; break; - case '-': /* must be after any flags */ - --optind; - goto endargs; case '?': default: usage(); } -endargs: argv += optind; argc -= optind; if (argc < 2 || argc > 4) usage(); - if (all && silent) { - fprintf(stderr, - "cmp: only one of -l and -s may be specified.\n"); - exit(EXITERR); - } + if (all && silent) + usage (); + if (strcmp(file1 = argv[0], "-") == 0) fd1 = 0; else if ((fd1 = open(file1, O_RDONLY, 0)) < 0) @@ -257,10 +252,8 @@ error(filename) endoffile(filename) char *filename; { - /* 32V put this message on stdout, S5 does it on stderr. */ - /* POSIX.2 currently does it on stdout-- Hooray! */ if (!silent) - (void) printf("cmp: EOF on %s\n", filename); + (void) fprintf(stderr, "cmp: EOF on %s\n", filename); exit(EXITDIFF); } @@ -270,6 +263,6 @@ endoffile(filename) */ usage() { - fputs("usage: cmp [-ls] file1 file2 [skip1] [skip2]\n", stderr); + fputs("usage: cmp [-l | -s] file1 file2 [skip1] [skip2]\n", stderr); exit(EXITERR); } |
