1 --- ../Libc/stdlib/FreeBSD/getopt.c 2004-11-25 11:38:41.000000000 -0800
2 +++ getopt.c 2005-01-26 19:27:09.000000000 -0800
5 #include "libc_private.h"
7 +#ifndef BUILDING_VARIANT
8 int opterr = 1, /* if error message should be printed */
9 optind = 1, /* index into parent argv vector */
10 optopt, /* character checked for validity */
11 optreset; /* reset getopt */
12 char *optarg; /* argument associated with option */
13 +#endif /* !BUILDING_VARIANT */
15 #define BADCH (int)'?'
16 #define BADARG (int)':'
20 +#define PROGNAME nargv[0]
22 +#define PROGNAME _getprogname()
27 * Parse argc/argv argument vector.
30 if (opterr && *ostr != ':')
32 - "%s: illegal option -- %c\n", _getprogname(),
34 + "%s: illegal option -- %c\n",
40 optarg = nargv[optind];
42 /* option-argument absent */
44 + /* Yes, the standard will put optind past the last
48 +#endif /* __DARWIN_UNIX03 */
54 "%s: option requires an argument -- %c\n",
55 - _getprogname(), optopt);