home *** CD-ROM | disk | FTP | other *** search
- /*
- getargv: get a value from argv, whether it is immediately following
- the flag or is the next argument. Complain if not found and exit.
-
- Kenneth Ingham
-
- Copyright (C) 1987 The University of New Mexico
- */
-
- #include "defs.h"
-
- getargv(what, argv, i, err)
- char *what, *argv[], *err;
- int i;
- {
- if (argv[i][2])
- (void) strcpy(what, &argv[i][2]);
- else {
- if (argv[++i])
- (void) strcpy(what, argv[i]);
- else {
- fprintf(stderr,"Missing %s!\n", err);
- exit(1);
- }
- }
- return i;
- }
-