diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libc/stdlib/getopt_long.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/getopt_long.c b/src/lib/libc/stdlib/getopt_long.c index 6079ce3503..bf50195b94 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.16 2004/02/04 18:17:25 millert Exp $ */ | 1 | /* $OpenBSD: getopt_long.c,v 1.17 2004/06/03 18:46:52 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) |
60 | static char *rcsid = "$OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $"; | 60 | static char *rcsid = "$OpenBSD: getopt_long.c,v 1.17 2004/06/03 18:46:52 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> |
@@ -474,9 +474,10 @@ start: | |||
474 | } else if (!(flags & FLAG_PERMUTE)) { | 474 | } else if (!(flags & FLAG_PERMUTE)) { |
475 | /* | 475 | /* |
476 | * If permutation is disabled, we can accept an | 476 | * If permutation is disabled, we can accept an |
477 | * optional arg separated by whitespace. | 477 | * optional arg separated by whitespace so long |
478 | * as it does not start with a dash (-). | ||
478 | */ | 479 | */ |
479 | if (optind + 1 < nargc) | 480 | if (optind + 1 < nargc && *nargv[optind + 1] != '-') |
480 | optarg = nargv[++optind]; | 481 | optarg = nargv[++optind]; |
481 | } | 482 | } |
482 | place = EMSG; | 483 | place = EMSG; |