summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblambert <>2010-07-22 19:31:53 +0000
committerblambert <>2010-07-22 19:31:53 +0000
commit7b3837a17bc96468eb10f5876dba92847b825eac (patch)
treee23b5fc67b7c9ed6356a180fab85391135e57d64
parent0b3843311a0246711269843c15163a0b47754758 (diff)
downloadopenbsd-7b3837a17bc96468eb10f5876dba92847b825eac.tar.gz
openbsd-7b3837a17bc96468eb10f5876dba92847b825eac.tar.bz2
openbsd-7b3837a17bc96468eb10f5876dba92847b825eac.zip
getopt_long.c replaced getopt.c 6+ years ago; we can retire
the REPLACE_GETOPT macro, at long last ok millert@
-rw-r--r--src/lib/libc/stdlib/getopt_long.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/lib/libc/stdlib/getopt_long.c b/src/lib/libc/stdlib/getopt_long.c
index 73d97c0ed3..eb1e3ef4be 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.23 2007/10/31 12:34:57 chl Exp $ */ 1/* $OpenBSD: getopt_long.c,v 1.24 2010/07/22 19:31:53 blambert 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/*
@@ -55,15 +55,11 @@
55#include <stdlib.h> 55#include <stdlib.h>
56#include <string.h> 56#include <string.h>
57 57
58#define REPLACE_GETOPT /* use this getopt as the system getopt(3) */
59
60#ifdef REPLACE_GETOPT
61int opterr = 1; /* if error message should be printed */ 58int opterr = 1; /* if error message should be printed */
62int optind = 1; /* index into parent argv vector */ 59int optind = 1; /* index into parent argv vector */
63int optopt = '?'; /* character checked for validity */ 60int optopt = '?'; /* character checked for validity */
64int optreset; /* reset getopt */ 61int optreset; /* reset getopt */
65char *optarg; /* argument associated with option */ 62char *optarg; /* argument associated with option */
66#endif
67 63
68#define PRINT_ERROR ((opterr) && (*options != ':')) 64#define PRINT_ERROR ((opterr) && (*options != ':'))
69 65
@@ -467,7 +463,6 @@ start:
467 return (optchar); 463 return (optchar);
468} 464}
469 465
470#ifdef REPLACE_GETOPT
471/* 466/*
472 * getopt -- 467 * getopt --
473 * Parse argc/argv argument vector. 468 * Parse argc/argv argument vector.
@@ -488,7 +483,6 @@ getopt(int nargc, char * const *nargv, const char *options)
488 */ 483 */
489 return (getopt_internal(nargc, nargv, options, NULL, NULL, 0)); 484 return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
490} 485}
491#endif /* REPLACE_GETOPT */
492 486
493/* 487/*
494 * getopt_long -- 488 * getopt_long --