summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2006-09-22 17:22:06 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2006-09-22 17:22:06 +0000
commitb3b212b370378c7a5c8a13c30c0abe7c4c758920 (patch)
treea792c3a7800ca54dc5c3e3840e7547e7321405ae /lib
parent1a9eb2e0f2226288262dbbeefa6eaf0e5019ae0b (diff)
Back out change in rev 1.15 of to allow whitespace to separate a
flag from its optional argument if permutation is disabled. The idea was that since "r:" would match "-r foo" then "r::" should match "-r foo" too as long as we know that things have not been reshuffled. Unfortunately, this causes incompatibilities with GNU getopt_long when the POSIXLY_CORRECT environment variable is set. OK deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/getopt_long.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/libc/stdlib/getopt_long.c b/lib/libc/stdlib/getopt_long.c
index 41b6cd9f8d8..db05a2d5fc0 100644
--- a/lib/libc/stdlib/getopt_long.c
+++ b/lib/libc/stdlib/getopt_long.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getopt_long.c,v 1.20 2005/10/25 15:49:37 jmc Exp $ */
+/* $OpenBSD: getopt_long.c,v 1.21 2006/09/22 17:22:05 millert Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
/*
@@ -457,7 +457,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;
@@ -467,14 +466,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 so long
- * as it does not start with a dash (-).
- */
- if (optind + 1 < nargc && *nargv[optind + 1] != '-')
- optarg = nargv[++optind];
}
place = EMSG;
++optind;