summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libc/stdlib/getopt_long.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/getopt_long.c b/src/lib/libc/stdlib/getopt_long.c
index 124893051c..1f7f5baa8b 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.14 2003/06/17 21:56:24 millert Exp $ */ 1/* $OpenBSD: getopt_long.c,v 1.15 2003/09/22 23:45:22 millert 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/*
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#if defined(LIBC_SCCS) && !defined(lint) 59#if defined(LIBC_SCCS) && !defined(lint)
60static char *rcsid = "$OpenBSD: getopt_long.c,v 1.14 2003/06/17 21:56:24 millert Exp $"; 60static char *rcsid = "$OpenBSD: getopt_long.c,v 1.15 2003/09/22 23:45:22 millert Exp $";
61#endif /* LIBC_SCCS and not lint */ 61#endif /* LIBC_SCCS and not lint */
62 62
63#include <err.h> 63#include <err.h>
@@ -472,6 +472,13 @@ start:
472 return (BADARG); 472 return (BADARG);
473 } else 473 } else
474 optarg = nargv[optind]; 474 optarg = nargv[optind];
475 } else if (!(flags & FLAG_PERMUTE)) {
476 /*
477 * If permutation is disabled, we can accept an
478 * optional arg separated by whitespace.
479 */
480 if (optind + 1 < nargc)
481 optarg = nargv[++optind];
475 } 482 }
476 place = EMSG; 483 place = EMSG;
477 ++optind; 484 ++optind;