summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/getopt_long.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2006-09-22 17:22:05 +0000
committermillert <millert@openbsd.org>2006-09-22 17:22:05 +0000
commita11a055177cbac37b4694f12ef2312791b8c1511 (patch)
tree1126a0ef24fc076bbfefca8ef67873bb019e794d /lib/libc/stdlib/getopt_long.c
parentRemove reference to LFS, okay deraadt@ (diff)
downloadwireguard-openbsd-a11a055177cbac37b4694f12ef2312791b8c1511.tar.xz
wireguard-openbsd-a11a055177cbac37b4694f12ef2312791b8c1511.zip
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/libc/stdlib/getopt_long.c')
-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;