getopt returns -1 not EOF
This commit is contained in:
parent
1d3ba85e36
commit
906b60f5e0
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: file.c,v 1.11 1997/01/28 00:49:40 christos Exp $ */
|
||||
/* $NetBSD: file.c,v 1.12 1997/10/18 14:49:41 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* file - find type of a file or files - main program.
|
||||
@ -28,7 +28,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static char *moduleid =
|
||||
"@(#)$NetBSD: file.c,v 1.11 1997/01/28 00:49:40 christos Exp $";
|
||||
"@(#)$NetBSD: file.c,v 1.12 1997/10/18 14:49:41 lukem Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdio.h>
|
||||
@ -105,7 +105,7 @@ char *argv[];
|
||||
if (!(magicfile = getenv("MAGIC")))
|
||||
magicfile = MAGIC;
|
||||
|
||||
while ((c = getopt(argc, argv, "vcdf:Lm:z")) != EOF)
|
||||
while ((c = getopt(argc, argv, "vcdf:Lm:z")) != -1)
|
||||
switch (c) {
|
||||
case 'v':
|
||||
(void) fprintf(stdout, "%s-%d.%d\n", progname,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.6 1997/01/09 20:19:14 tls Exp $ */
|
||||
/* $NetBSD: main.c,v 1.7 1997/10/18 14:49:45 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";*/
|
||||
static char rcsid[] = "$NetBSD: main.c,v 1.6 1997/01/09 20:19:14 tls Exp $";
|
||||
static char rcsid[] = "$NetBSD: main.c,v 1.7 1997/10/18 14:49:45 lukem Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -73,7 +73,7 @@ main(argc, argv)
|
||||
|
||||
p = start = argv;
|
||||
ftsoptions = FTS_NOSTAT|FTS_PHYSICAL;
|
||||
while ((ch = getopt(argc, argv, "Hdf:hXx")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "Hdf:hXx")) != -1)
|
||||
switch(ch) {
|
||||
case 'H':
|
||||
ftsoptions |= FTS_COMFOLLOW;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: finger.c,v 1.8 1997/09/09 02:41:08 mrg Exp $ */
|
||||
/* $NetBSD: finger.c,v 1.9 1997/10/18 14:49:48 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@ -54,7 +54,7 @@ char copyright[] =
|
||||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)finger.c 5.22 (Berkeley) 6/29/90";*/
|
||||
static char rcsid[] = "$NetBSD: finger.c,v 1.8 1997/09/09 02:41:08 mrg Exp $";
|
||||
static char rcsid[] = "$NetBSD: finger.c,v 1.9 1997/10/18 14:49:48 lukem Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -94,7 +94,7 @@ main(argc, argv)
|
||||
|
||||
oflag = 1; /* default to old "office" behavior */
|
||||
|
||||
while ((ch = getopt(argc, argv, "lmpshog")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "lmpshog")) != -1)
|
||||
switch(ch) {
|
||||
case 'l':
|
||||
lflag = 1; /* long format */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */
|
||||
/* $NetBSD: from.c,v 1.7 1997/10/18 14:49:50 lukem Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1988, 1993
|
||||
@ -43,7 +43,7 @@ static char copyright[] =
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
static char rcsid[] = "$NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $";
|
||||
static char rcsid[] = "$NetBSD: from.c,v 1.7 1997/10/18 14:49:50 lukem Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -70,7 +70,7 @@ main(argc, argv)
|
||||
#endif
|
||||
|
||||
file = sender = NULL;
|
||||
while ((ch = getopt(argc, argv, "f:s:")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "f:s:")) != -1)
|
||||
switch((char)ch) {
|
||||
case 'f':
|
||||
file = optarg;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fstat.c,v 1.21 1997/10/18 11:38:27 mrg Exp $ */
|
||||
/* $NetBSD: fstat.c,v 1.22 1997/10/18 14:49:52 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988, 1993
|
||||
@ -43,7 +43,7 @@ static char copyright[] =
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)fstat.c 8.3 (Berkeley) 5/2/95";
|
||||
#else
|
||||
static char *rcsid = "$NetBSD: fstat.c,v 1.21 1997/10/18 11:38:27 mrg Exp $";
|
||||
static char *rcsid = "$NetBSD: fstat.c,v 1.22 1997/10/18 14:49:52 lukem Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -167,7 +167,7 @@ main(argc, argv)
|
||||
arg = 0;
|
||||
what = KERN_PROC_ALL;
|
||||
nlistf = memf = NULL;
|
||||
while ((ch = getopt(argc, argv, "fnp:u:vN:M:")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "fnp:u:vN:M:")) != -1)
|
||||
switch((char)ch) {
|
||||
case 'f':
|
||||
fsflg = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user