works on Linux 2.6
This commit is contained in:
parent
78e51a8c66
commit
359c1e017e
14 changed files with 33 additions and 28 deletions
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@ HFILES=comments.h\
|
|||
|
||||
<$PLAN9/src/mklib
|
||||
|
||||
CFLAGS=-c -D$SYSTEM -D_POSIX_SOURCE
|
||||
CFLAGS=-c -D$SYSTEM
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue