diff options
author | imp <imp@cvs.openbsd.org> | 1996-09-28 19:36:39 +0000 |
---|---|---|
committer | imp <imp@cvs.openbsd.org> | 1996-09-28 19:36:39 +0000 |
commit | 00fd466ec742481dea241994becfeecdf7239116 (patch) | |
tree | 15405134adf19c9674d1730f5a6fa6eb2a3bf42d /bin | |
parent | 80ead4068877d174f6d3cacdc16d14c0ce53ec6d (diff) |
Fix the return value of test of getopt. It is documented to return
EOF when there are no more args to process. This happens also to be a
trivial difference between FreeBSD and OpenBSD which FreeBSD has
right. Shouldn't break anything because EOF is #defined to be -1 on
BSD systems.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cat/cat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c index d193f27b349..178d3b09828 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cat.c,v 1.4 1996/08/02 17:39:50 tholo Exp $ */ +/* $OpenBSD: cat.c,v 1.5 1996/09/28 19:36:38 imp Exp $ */ /* $NetBSD: cat.c,v 1.11 1995/09/07 06:12:54 jtc Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95"; #else -static char rcsid[] = "$OpenBSD: cat.c,v 1.4 1996/08/02 17:39:50 tholo Exp $"; +static char rcsid[] = "$OpenBSD: cat.c,v 1.5 1996/09/28 19:36:38 imp Exp $"; #endif #endif /* not lint */ @@ -83,7 +83,7 @@ main(argc, argv) setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "benstuv")) != -1) + while ((ch = getopt(argc, argv, "benstuv")) != EOF) switch (ch) { case 'b': bflag = nflag = 1; /* -b implies -n */ |