projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new copyright; att/bsd/shared
[unix-history]
/
usr
/
src
/
lib
/
libc
/
stdlib
/
getopt.c
diff --git
a/usr/src/lib/libc/stdlib/getopt.c
b/usr/src/lib/libc/stdlib/getopt.c
index
2940b93
..
a184fb1
100644
(file)
--- a/
usr/src/lib/libc/stdlib/getopt.c
+++ b/
usr/src/lib/libc/stdlib/getopt.c
@@
-6,10
+6,12
@@
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getopt.c 4.1
2
(Berkeley) %G%";
+static char sccsid[] = "@(#)getopt.c 4.1
3
(Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
/*
* get option letter from argument vector
/*
* get option letter from argument vector
@@
-22,13
+24,15
@@
char *optarg; /* argument associated with option */
#define BADCH (int)'?'
#define EMSG ""
#define BADCH (int)'?'
#define EMSG ""
+int
getopt(nargc, nargv, ostr)
int nargc;
getopt(nargc, nargv, ostr)
int nargc;
- char **nargv, *ostr;
+ char * const *nargv;
+ const char *ostr;
{
static char *place = EMSG; /* option letter processing */
register char *oli; /* option letter list index */
{
static char *place = EMSG; /* option letter processing */
register char *oli; /* option letter list index */
- char *p
, *index(), *rindex()
;
+ char *p;
if (!*place) { /* update scanning pointer */
if (optind >= nargc || *(place = nargv[optind]) != '-') {
if (!*place) { /* update scanning pointer */
if (optind >= nargc || *(place = nargv[optind]) != '-') {