bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] Re: new module: getsubopt


From: Bruno Haible
Subject: Re: [Bug-gnulib] Re: new module: getsubopt
Date: Fri, 6 Aug 2004 22:28:06 +0200
User-agent: KMail/1.5

Simon Josefsson wrote:
> I hope this addresses all issues.
>
> 2004-08-02  Simon Josefsson  <address@hidden>
>
>       * MODULES.html.sh (Support for systems lacking POSIX:2001): Add
>       getsubopt.
>
> 2004-08-01  Simon Josefsson  <address@hidden>
>
>       * modules/getsubopt: New file.
>
> 2004-08-01  Simon Josefsson  <address@hidden>
>
>       * getsubopt.h: New file.
>       * getsubopt.c: New file, from glibc, but slightly modified based
>       on suggestions from Paul Eggert <address@hidden>.
>
> 2004-08-01  Simon Josefsson  <address@hidden>
>
>       * getsubopt.m4: New file.

Thanks. I've added your patch. And added some comments to the new file
getsubopt.h. While doing this I noted an issue that may be a glibc bug:

Does the POSIX:2001 description paragraph "If the string at *optionp ...
value for the suboption is an error." hold only for the case that
the "token" is found among the keylist, i.e. when the return value is >= 0?

Or does it hold also when the return value is -1?

In the first case, an application must be aware that *OPTIONP and *VALUEP
are undefined after getsubopt() returns -1. (Or maybe they should both be
unchanged??) I.e. the search loop cannot be continued by the calling program,
as in the other case.

In the second case, glibc is in error if it sets *VALUEP specially.

Bruno





reply via email to

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