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.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.3')
-rw-r--r-- | src/lib/libc/stdlib/getopt.3 | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3 index 82f74c2c1a..ecdf42ab76 100644 --- a/src/lib/libc/stdlib/getopt.3 +++ b/src/lib/libc/stdlib/getopt.3 | |||
@@ -25,9 +25,9 @@ | |||
25 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
26 | .\" SUCH DAMAGE. | 26 | .\" SUCH DAMAGE. |
27 | .\" | 27 | .\" |
28 | .\" $OpenBSD: getopt.3,v 1.41 2009/04/12 23:13:36 okan Exp $ | 28 | .\" $OpenBSD: getopt.3,v 1.42 2011/03/05 22:10:11 guenther Exp $ |
29 | .\" | 29 | .\" |
30 | .Dd $Mdocdate: April 12 2009 $ | 30 | .Dd $Mdocdate: March 5 2011 $ |
31 | .Dt GETOPT 3 | 31 | .Dt GETOPT 3 |
32 | .Os | 32 | .Os |
33 | .Sh NAME | 33 | .Sh NAME |
@@ -158,15 +158,6 @@ is set to the character that caused the error. | |||
158 | The | 158 | The |
159 | .Fn getopt | 159 | .Fn getopt |
160 | function returns \-1 when the argument list is exhausted. | 160 | function returns \-1 when the argument list is exhausted. |
161 | .Sh ENVIRONMENT | ||
162 | .Bl -tag -width POSIXLY_CORRECTXX | ||
163 | .It Ev POSIXLY_CORRECT | ||
164 | If set, a leading | ||
165 | .Sq - | ||
166 | in | ||
167 | .Ar optstring | ||
168 | is ignored. | ||
169 | .El | ||
170 | .Sh EXAMPLES | 161 | .Sh EXAMPLES |
171 | The following code accepts the options | 162 | The following code accepts the options |
172 | .Fl b | 163 | .Fl b |