summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/getopt_long.3
diff options
context:
space:
mode:
authorguenther <>2011-03-05 22:10:11 +0000
committerguenther <>2011-03-05 22:10:11 +0000
commit9d057237f371a465ccec3f1a7a68c19af8920051 (patch)
tree448ef6b71a537dcd5d0e6ce2a7893a402dc7c930 /src/lib/libc/stdlib/getopt_long.3
parent40abb7da20d82cdfbe24fc623f51d100e7ae76d4 (diff)
downloadopenbsd-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.323
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
212handling of 212handling of
213.Ql - 213.Ql -
214as the first character of the option string in the presence of the
215environment variable
216.Ev POSIXLY_CORRECT :
217.Bl -tag -width "OpenBSD"
218.It GNU
219ignores
220.Ev POSIXLY_CORRECT
221and returns non-options as arguments to option
222.Ql \e1 .
223.It OpenBSD
224honors
225.Ev POSIXLY_CORRECT
226and stops at the first non-option.
227.El
228.It
229handling of
230.Ql -
231within the option string (not the first character): 214within 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
403If set, option processing stops when the first non-option is found and 386If set, option processing stops when the first non-option is found and
404a leading 387a leading
405.Sq -
406or
407.Sq + 388.Sq +
408in the 389in the
409.Ar optstring 390.Ar optstring