[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-gengetopt] bug: gengetopt v.2.19.2
From: |
Lorenzo Bettini |
Subject: |
Re: [help-gengetopt] bug: gengetopt v.2.19.2 |
Date: |
Fri, 08 Jun 2007 18:48:28 +0200 |
User-agent: |
Icedove 1.5.0.10 (X11/20070329) |
TM wrote:
> Hi Lorenzo,
>
> I've come across a bug in gengetopt version 2.19.2 when option
> include-getopt' is used. I attach a small project to demonstrate the issue.
>
> Basically, if there are 2 options Q and W and the program is invoked as:
> prog -Q -W
> everything is fine. However, if the program is invoked as:
> prog -QW
> gengetopt generates an error message and terminates the program.
>
> I am using Microsoft Visual Studio to compile the project. However, up
> to and including version 2.19.1 I have used a version of getopt taken
> from glibc and never had any such problems. I believe that this is a bug
> in the implementation of getopt that was added to version 2.19.2 of
> gengetopt.
>
Hi there
(you're Tiago Menezes aren't you?)
you were right about the bug!
the wrong code line is this one
if (d->custom_optind == 1 || d->custom_optind == 0 || !d->initialized) {
which must be changed into
if (d->custom_optind == 0 || !d->initialized) {
I've uploaded this fixed temporary release here
http://rap.dsi.unifi.it/~bettini/gengetopt-2.20.tar.gz
hope to hear from you soon
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net