aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/postscript/common/getopt.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-14 04:24:09 +0000
committerrsc <devnull@localhost>2005-01-14 04:24:09 +0000
commit359c1e017ee367c34b082b1b4e6c002686d01bce (patch)
tree84b17b7a46cc9c7ec00a206ec5d4c2159a1b4927 /src/cmd/postscript/common/getopt.c
parent78e51a8c6678b6e3dff3d619aa786669f531f4bc (diff)
works on Linux 2.6
Diffstat (limited to 'src/cmd/postscript/common/getopt.c')
-rw-r--r--src/cmd/postscript/common/getopt.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/cmd/postscript/common/getopt.c b/src/cmd/postscript/common/getopt.c
index e348cb2f..018885f7 100644
--- a/src/cmd/postscript/common/getopt.c
+++ b/src/cmd/postscript/common/getopt.c
@@ -1,18 +1,13 @@
-#ifndef _POSIX_SOURCE
-#include <u.h>
-#include <libc.h>
-#endif
#include <stdio.h>
+#include <string.h>
#define ERR(str, chr) if(opterr){fprintf(stderr, "%s%s%c\n", argv[0], str, chr);}
int opterr = 1;
int optind = 1;
int optopt;
char *optarg;
-char *strchr();
int
-getopt (argc, argv, opts)
-char **argv, *opts;
+getopt (int argc, char **argv, char *opts)
{
static int sp = 1;
register int c;
@@ -22,7 +17,7 @@ char **argv, *opts;
if (optind >= argc ||
argv[optind][0] != '-' || argv[optind][1] == '\0')
return EOF;
- else if (strcmp(argv[optind], "--") == NULL) {
+ else if (strcmp(argv[optind], "--") == 0) {
optind++;
return EOF;
}