From 9d057237f371a465ccec3f1a7a68c19af8920051 Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sat, 5 Mar 2011 22:10:11 +0000 Subject: 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@ --- src/lib/libc/stdlib/getopt.3 | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/lib/libc/stdlib/getopt.3') 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 @@ .\" 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 -- cgit v1.2.3-55-g6feb