This is the mail archive of the
cygwin-developers
mailing list for the Cygwin project.
Re: getopt bugs
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-developers at cygwin dot com
- Date: Tue, 1 Dec 2009 15:48:40 +0100
- Subject: Re: getopt bugs
- References: <loom.20091130T173232-79@post.gmane.org> <20091130174756.GA30043@calimero.vinschen.de> <loom.20091130T194900-224@post.gmane.org> <20091201094243.GD30043@calimero.vinschen.de> <4B151FC9.8000905@byu.net>
- Reply-to: cygwin-developers at cygwin dot com
On Dec 1 06:53, Eric Blake wrote:
> According to Corinna Vinschen on 12/1/2009 2:42 AM:
> > I tend to the first choice with a rather strong option to the third.
> >
> > A patch for the first choice might look like this (untested):
> >
> > * libc/getopt.c (getopt_internal): Reevaluate POSIXLY_CORRECT
> > if optind is set to 0. Handle a leading '-' in options independently
> > of posixly_correct.
>
> Looks decent to me, although you might also want to let optreset!=0 cause
> a reread (since later on, optind==0 is translated to optreset=1).
Good idea.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat