diff options
author | guenther <> | 2011-03-05 22:10:11 +0000 |
---|---|---|
committer | guenther <> | 2011-03-05 22:10:11 +0000 |
commit | 9d057237f371a465ccec3f1a7a68c19af8920051 (patch) | |
tree | 448ef6b71a537dcd5d0e6ce2a7893a402dc7c930 /src/lib/libc/stdlib/getopt_long.3 | |
parent | 40abb7da20d82cdfbe24fc623f51d100e7ae76d4 (diff) | |
download | openbsd-9d057237f371a465ccec3f1a7a68c19af8920051.tar.gz openbsd-9d057237f371a465ccec3f1a7a68c19af8920051.tar.bz2 openbsd-9d057237f371a465ccec3f1a7a68c19af8920051.zip |
Fix PR 6267: recheck POSIXLY_CORRECT each time getopt_long() starts a new
argv and don't suppress the handling of leading '-' in optstring when
POSIXLY_CORRECT is set.
Based on patch from Eric Blake.
ok and manpage update from millert@, manpage ok jmc@
Diffstat (limited to 'src/lib/libc/stdlib/getopt_long.3')
-rw-r--r-- | src/lib/libc/stdlib/getopt_long.3 | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/lib/libc/stdlib/getopt_long.3 b/src/lib/libc/stdlib/getopt_long.3 index c2b0db6452..fe3a54bbcd 100644 --- a/src/lib/libc/stdlib/getopt_long.3 +++ b/src/lib/libc/stdlib/getopt_long.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: getopt_long.3,v 1.17 2011/01/24 01:50:25 schwarze Exp $ | 1 | .\" $OpenBSD: getopt_long.3,v 1.18 2011/03/05 22:10:11 guenther Exp $ |
2 | .\" $NetBSD: getopt_long.3,v 1.11 2002/10/02 10:54:19 wiz Exp $ | 2 | .\" $NetBSD: getopt_long.3,v 1.11 2002/10/02 10:54:19 wiz Exp $ |
3 | .\" | 3 | .\" |
4 | .\" Copyright (c) 1988, 1991, 1993 | 4 | .\" Copyright (c) 1988, 1991, 1993 |
@@ -30,7 +30,7 @@ | |||
30 | .\" | 30 | .\" |
31 | .\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 | 31 | .\" @(#)getopt.3 8.5 (Berkeley) 4/27/95 |
32 | .\" | 32 | .\" |
33 | .Dd $Mdocdate: January 24 2011 $ | 33 | .Dd $Mdocdate: March 5 2011 $ |
34 | .Dt GETOPT_LONG 3 | 34 | .Dt GETOPT_LONG 3 |
35 | .Os | 35 | .Os |
36 | .Sh NAME | 36 | .Sh NAME |
@@ -211,23 +211,6 @@ found in glibc-2.1.3: | |||
211 | .It | 211 | .It |
212 | handling of | 212 | handling of |
213 | .Ql - | 213 | .Ql - |
214 | as the first character of the option string in the presence of the | ||
215 | environment variable | ||
216 | .Ev POSIXLY_CORRECT : | ||
217 | .Bl -tag -width "OpenBSD" | ||
218 | .It GNU | ||
219 | ignores | ||
220 | .Ev POSIXLY_CORRECT | ||
221 | and returns non-options as arguments to option | ||
222 | .Ql \e1 . | ||
223 | .It OpenBSD | ||
224 | honors | ||
225 | .Ev POSIXLY_CORRECT | ||
226 | and stops at the first non-option. | ||
227 | .El | ||
228 | .It | ||
229 | handling of | ||
230 | .Ql - | ||
231 | within the option string (not the first character): | 214 | within the option string (not the first character): |
232 | .Bl -tag -width "OpenBSD" | 215 | .Bl -tag -width "OpenBSD" |
233 | .It GNU | 216 | .It GNU |
@@ -402,8 +385,6 @@ relative to current positions) are the same, though. | |||
402 | .It Ev POSIXLY_CORRECT | 385 | .It Ev POSIXLY_CORRECT |
403 | If set, option processing stops when the first non-option is found and | 386 | If set, option processing stops when the first non-option is found and |
404 | a leading | 387 | a leading |
405 | .Sq - | ||
406 | or | ||
407 | .Sq + | 388 | .Sq + |
408 | in the | 389 | in the |
409 | .Ar optstring | 390 | .Ar optstring |