diff options
author | 2011-03-05 22:10:11 +0000 | |
---|---|---|
committer | 2011-03-05 22:10:11 +0000 | |
commit | ebb4ed69e98da281c0adb4141a4d2f42eeae3ce8 (patch) | |
tree | 1715fbe8a4820d550e11151a9ca42083c8609544 /lib/libc/stdlib/getopt.3 | |
parent | Fix potential crash when GZIP variable set and more than 512 command (diff) | |
download | wireguard-openbsd-ebb4ed69e98da281c0adb4141a4d2f42eeae3ce8.tar.xz wireguard-openbsd-ebb4ed69e98da281c0adb4141a4d2f42eeae3ce8.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 'lib/libc/stdlib/getopt.3')
-rw-r--r-- | lib/libc/stdlib/getopt.3 | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/libc/stdlib/getopt.3 b/lib/libc/stdlib/getopt.3 index 82f74c2c1a5..ecdf42ab766 100644 --- a/lib/libc/stdlib/getopt.3 +++ b/lib/libc/stdlib/getopt.3 @@ -25,9 +25,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: getopt.3,v 1.41 2009/04/12 23:13:36 okan Exp $ +.\" $OpenBSD: getopt.3,v 1.42 2011/03/05 22:10:11 guenther Exp $ .\" -.Dd $Mdocdate: April 12 2009 $ +.Dd $Mdocdate: March 5 2011 $ .Dt GETOPT 3 .Os .Sh NAME @@ -158,15 +158,6 @@ is set to the character that caused the error. The .Fn getopt function returns \-1 when the argument list is exhausted. -.Sh ENVIRONMENT -.Bl -tag -width POSIXLY_CORRECTXX -.It Ev POSIXLY_CORRECT -If set, a leading -.Sq - -in -.Ar optstring -is ignored. -.El .Sh EXAMPLES The following code accepts the options .Fl b |