[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] QUERY: options parsing for guimb ( guimb/main.c/pars

From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] QUERY: options parsing for guimb ( guimb/main.c/parse_opt:76 )
Date: Thu, 03 Feb 2005 12:53:20 +0200

Dolter, James <address@hidden> wrote:

> When I take a closer look at the parse_opt function (lines 77 - 121)
> there are references to optarg.
> This appears incorrect since I don't believe that the stock argp_parse
> in glibc updates/modifies these globals.

You are right, it is a leftover from old times when we were using
getopt_long. Obviously it used to work because argp usually
uses getopt_long, which in turn modify optarg.

> Shouldn't these be references to the parameter 'arg'?

Yes, it should. Thanks for pointing out the bug.

> Just what where you trying to do with the manipulation of the
> state->next and state->input on the 's' and 'c' matches?

Setting state->next prevents the rest of command line from being parsed.
Setting state->input returns the index of the first unparsed argument
which is then used to create `command-line' for guile (the arg_index
argument to argp_parse cannot be used in this case because it will
always be equal to argc).


reply via email to

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