diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2004-07-06 13:58:45 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2004-07-06 13:58:45 +0000 |
| commit | 42aeacc4d489803624d7982c7b43699c4a9a8300 (patch) | |
| tree | f5013f0db7d4264d676cd0492e984c67f55f9343 /lib/libc/stdlib/getopt_long.c | |
| parent | cef924194577436f64ae1f6f6cf35e2eedd0f852 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib/getopt_long.c')
| -rw-r--r-- | lib/libc/stdlib/getopt_long.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdlib/getopt_long.c b/lib/libc/stdlib/getopt_long.c index 28e24ae3097f..47eab1ffbc75 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.16 2004/02/04 18:17:25 millert Exp $ */ +/* $OpenBSD: getopt_long.c,v 1.17 2004/06/03 18:46:52 millert Exp $ */ /* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ /* @@ -571,9 +571,10 @@ start: } else if (!(flags & FLAG_PERMUTE)) { /* * If permutation is disabled, we can accept an - * optional arg separated by whitespace. + * optional arg separated by whitespace so long + * as it does not start with a dash (-). */ - if (optind + 1 < nargc) + if (optind + 1 < nargc && *nargv[optind + 1] != '-') optarg = nargv[++optind]; } place = EMSG; |
