getopt returns -1 not EOF

This commit is contained in:
lukem 1997-10-17 00:07:21 +00:00
parent 251114507c
commit df4958aa0b
6 changed files with 13 additions and 13 deletions

View File

@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: get_args.c,v 1.5 1997/09/22 22:10:16 christos Exp $
* $Id: get_args.c,v 1.6 1997/10/17 00:07:21 lukem Exp $
*
*/
@ -124,7 +124,7 @@ get_args(int c, char *v[])
int opt_ch;
FILE *fp = stdin;
while ((opt_ch = getopt(c, v, "nprvSa:c:d:k:l:o:t:w:x:y:C:D:F:T:H")) != EOF)
while ((opt_ch = getopt(c, v, "nprvSa:c:d:k:l:o:t:w:x:y:C:D:F:T:H")) != -1)
switch (opt_ch) {

View File

@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: amq.c,v 1.7 1997/09/26 17:00:29 christos Exp $
* $Id: amq.c,v 1.8 1997/10/17 00:07:28 lukem Exp $
*
*/
@ -54,7 +54,7 @@ char copyright[] = "\
@(#)Copyright (c) 1990 The Regents of the University of California.\n\
@(#)All rights reserved.\n";
#if __GNUC__ < 2
static char rcsid[] = "$Id: amq.c,v 1.7 1997/09/26 17:00:29 christos Exp $";
static char rcsid[] = "$Id: amq.c,v 1.8 1997/10/17 00:07:28 lukem Exp $";
static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* __GNUC__ < 2 */
#endif /* not lint */
@ -329,7 +329,7 @@ main(int argc, char *argv[])
/*
* Parse arguments
*/
while ((opt_ch = getopt(argc, argv, "fh:l:msuvx:D:M:pP:")) != EOF)
while ((opt_ch = getopt(argc, argv, "fh:l:msuvx:D:M:pP:")) != -1)
switch (opt_ch) {
case 'f':
flush_flag = 1;

View File

@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: fixmount.c,v 1.1.1.2 1997/09/26 16:08:10 christos Exp $
* $Id: fixmount.c,v 1.2 1997/10/17 00:07:35 lukem Exp $
*
*/
@ -287,7 +287,7 @@ main(int argc, char *argv[])
register int rpcs = 0;
struct timeval tv;
while ((ch = getopt(argc, argv, "adervAqfh:")) != EOF)
while ((ch = getopt(argc, argv, "adervAqfh:")) != -1)
switch ((char) ch) {
case 'a':

View File

@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: fsinfo.c,v 1.4 1997/07/24 23:18:31 christos Exp $
* $Id: fsinfo.c,v 1.5 1997/10/17 00:07:41 lukem Exp $
*
*/
@ -109,7 +109,7 @@ fsi_get_args(int c, char *v[])
if (!progname)
progname = "fsinfo";
while ((ch = getopt(c, v, "a:b:d:e:f:h:m:D:U:I:qv")) != EOF)
while ((ch = getopt(c, v, "a:b:d:e:f:h:m:D:U:I:qv")) != -1)
switch (ch) {

View File

@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: hlfsd.c,v 1.1.1.3 1997/09/26 16:07:39 christos Exp $
* $Id: hlfsd.c,v 1.2 1997/10/17 00:07:49 lukem Exp $
*
* HLFSD was written at Columbia University Computer Science Department, by
* Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
@ -179,7 +179,7 @@ main(int argc, char *argv[])
if ((int) strlen(progname) > PROGNAMESZ) /* truncate to reasonable size */
progname[PROGNAMESZ] = '\0';
while ((opt = getopt(argc, argv, "a:c:CD:fg:hi:l:no:px:v")) != EOF)
while ((opt = getopt(argc, argv, "a:c:CD:fg:hi:l:no:px:v")) != -1)
switch (opt) {
case 'a':

View File

@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
* $Id: mk-amd-map.c,v 1.4 1997/07/24 23:18:56 christos Exp $
* $Id: mk-amd-map.c,v 1.5 1997/10/17 00:07:55 lukem Exp $
*/
/*
@ -228,7 +228,7 @@ main(int argc, char *argv[])
extern int optind;
/* test options */
while ((ch = getopt(argc, argv, "p")) != EOF)
while ((ch = getopt(argc, argv, "p")) != -1)
switch (ch) {
case 'p':
printit = 1;