diff options
author | millert <> | 2003-06-02 03:46:43 +0000 |
---|---|---|
committer | millert <> | 2003-06-02 03:46:43 +0000 |
commit | 811c6edb6cd0cf5b921627c5c094ed11ed3851df (patch) | |
tree | d8cf64e8f36bc83f954594ac7375cd35e0731062 /src/lib | |
parent | 5796457847338c884c1863d78addddafce4fc02f (diff) | |
download | openbsd-811c6edb6cd0cf5b921627c5c094ed11ed3851df.tar.gz openbsd-811c6edb6cd0cf5b921627c5c094ed11ed3851df.tar.bz2 openbsd-811c6edb6cd0cf5b921627c5c094ed11ed3851df.zip |
Use the getopt() in getopt_long.c which supports some GNU extensions.
getopt.c is no longer compiled and will eventually be removed.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libc/stdlib/Makefile.inc | 2 | ||||
-rw-r--r-- | src/lib/libc/stdlib/getopt_long.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/Makefile.inc b/src/lib/libc/stdlib/Makefile.inc index bfbbdcb7f4..b3be1f7bc2 100644 --- a/src/lib/libc/stdlib/Makefile.inc +++ b/src/lib/libc/stdlib/Makefile.inc | |||
@@ -4,7 +4,7 @@ | |||
4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/stdlib ${LIBCSRCDIR}/stdlib | 4 | .PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/stdlib ${LIBCSRCDIR}/stdlib |
5 | 5 | ||
6 | SRCS+= a64l.c abort.c atexit.c atoi.c atof.c atol.c atoll.c bsearch.c \ | 6 | SRCS+= a64l.c abort.c atexit.c atoi.c atof.c atol.c atoll.c bsearch.c \ |
7 | calloc.c cfree.c exit.c ecvt.c gcvt.c getenv.c getopt.c getopt_long.c \ | 7 | calloc.c cfree.c exit.c ecvt.c gcvt.c getenv.c getopt_long.c \ |
8 | getsubopt.c heapsort.c l64a.c lsearch.c malloc.c merge.c \ | 8 | getsubopt.c heapsort.c l64a.c lsearch.c malloc.c merge.c \ |
9 | multibyte.c putenv.c qsort.c radixsort.c rand.c random.c realpath.c \ | 9 | multibyte.c putenv.c qsort.c radixsort.c rand.c random.c realpath.c \ |
10 | setenv.c strtod.c strtol.c strtoll.c strtoul.c strtoull.c system.c \ | 10 | setenv.c strtod.c strtol.c strtoll.c strtoul.c strtoull.c system.c \ |
diff --git a/src/lib/libc/stdlib/getopt_long.c b/src/lib/libc/stdlib/getopt_long.c index 0cdc4d652f..340065e3a0 100644 --- a/src/lib/libc/stdlib/getopt_long.c +++ b/src/lib/libc/stdlib/getopt_long.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert Exp $ */ | 1 | /* $OpenBSD: getopt_long.c,v 1.12 2003/06/02 03:46:43 millert Exp $ */ |
2 | /* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ | 2 | /* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ |
3 | 3 | ||
4 | /* | 4 | /* |
@@ -64,7 +64,7 @@ | |||
64 | */ | 64 | */ |
65 | 65 | ||
66 | #if defined(LIBC_SCCS) && !defined(lint) | 66 | #if defined(LIBC_SCCS) && !defined(lint) |
67 | static char *rcsid = "$OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert Exp $"; | 67 | static char *rcsid = "$OpenBSD: getopt_long.c,v 1.12 2003/06/02 03:46:43 millert Exp $"; |
68 | #endif /* LIBC_SCCS and not lint */ | 68 | #endif /* LIBC_SCCS and not lint */ |
69 | 69 | ||
70 | #include <err.h> | 70 | #include <err.h> |
@@ -73,6 +73,8 @@ static char *rcsid = "$OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert | |||
73 | #include <stdlib.h> | 73 | #include <stdlib.h> |
74 | #include <string.h> | 74 | #include <string.h> |
75 | 75 | ||
76 | #define REPLACE_GETOPT /* use this getopt as the system getopt(3) */ | ||
77 | |||
76 | #ifdef REPLACE_GETOPT | 78 | #ifdef REPLACE_GETOPT |
77 | int opterr = 1; /* if error message should be printed */ | 79 | int opterr = 1; /* if error message should be printed */ |
78 | int optind = 1; /* index into parent argv vector */ | 80 | int optind = 1; /* index into parent argv vector */ |