[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 (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

hope to hear from you soon

Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]