summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/libc/getopt.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-05-08 14:41:47 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-05-08 14:41:47 +0000
commit72d1a8a04aa8675f4d878f45c6ec69d45effcfd6 (patch)
tree6cfdd118128c11e955c1e050c5c490c82b3091e1 /winsup/cygwin/libc/getopt.c
parenta8e45d3968c8c5bdc34b800d3e2c68d416181470 (diff)
downloadcygnal-72d1a8a04aa8675f4d878f45c6ec69d45effcfd6.tar.gz
cygnal-72d1a8a04aa8675f4d878f45c6ec69d45effcfd6.tar.bz2
cygnal-72d1a8a04aa8675f4d878f45c6ec69d45effcfd6.zip
* Makefile.in (DLL_OFILES): Add _def_time.o. Remove timelocal.o.
* include/sys/localedef.h: New file from NetBSD. * libc/_def_time.c: Ditto. * libc/getopt.c: Update to latest OpenBSD version 1.23. * libc/strptime.cc: Replace FreeBSD version 1.35 with latest NetBSD version 1.28. * libc/timelocal.cc: Remove. * libc/timelocal.h: Remove.
Diffstat (limited to 'winsup/cygwin/libc/getopt.c')
-rw-r--r--winsup/cygwin/libc/getopt.c39
1 files changed, 6 insertions, 33 deletions
diff --git a/winsup/cygwin/libc/getopt.c b/winsup/cygwin/libc/getopt.c
index 0ed46310e..bbd1f37dd 100644
--- a/winsup/cygwin/libc/getopt.c
+++ b/winsup/cygwin/libc/getopt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $ */
+/* $OpenBSD: getopt_long.c,v 1.23 2007/10/31 12:34:57 chl Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
/*
@@ -35,13 +35,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -56,10 +49,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $";
-#endif /* LIBC_SCCS and not lint */
-
#include <err.h>
#include <errno.h>
#include <getopt.h>
@@ -465,7 +454,6 @@ start:
optarg = NULL;
if (*place) /* no white space */
optarg = place;
- /* XXX: disable test for :: if PC? (GNU doesn't) */
else if (oli[1] != ':') { /* arg not optional */
if (++optind >= nargc) { /* no arg */
place = EMSG;
@@ -475,13 +463,6 @@ start:
return (BADARG);
} else
optarg = nargv[optind];
- } else if (!(flags & FLAG_PERMUTE)) {
- /*
- * If permutation is disabled, we can accept an
- * optional arg separated by whitespace.
- */
- if (optind + 1 < nargc)
- optarg = nargv[++optind];
}
place = EMSG;
++optind;
@@ -502,7 +483,7 @@ getopt(int nargc, char * const *nargv, const char *options)
{
/*
- * We dont' pass FLAG_PERMUTE to getopt_internal() since
+ * We don't pass FLAG_PERMUTE to getopt_internal() since
* the BSD getopt(3) (unlike GNU) has never done this.
*
* Furthermore, since many privileged programs call getopt()
@@ -518,12 +499,8 @@ getopt(int nargc, char * const *nargv, const char *options)
* Parse argc/argv argument vector.
*/
int
-getopt_long(nargc, nargv, options, long_options, idx)
- int nargc;
- char * const *nargv;
- const char *options;
- const struct option *long_options;
- int *idx;
+getopt_long(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx)
{
return (getopt_internal(nargc, nargv, options, long_options, idx,
@@ -535,12 +512,8 @@ getopt_long(nargc, nargv, options, long_options, idx)
* Parse argc/argv argument vector.
*/
int
-getopt_long_only(nargc, nargv, options, long_options, idx)
- int nargc;
- char * const *nargv;
- const char *options;
- const struct option *long_options;
- int *idx;
+getopt_long_only(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx)
{
return (getopt_internal(nargc, nargv, options, long_options, idx,