[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] Re: new module: getsubopt
From: |
Simon Josefsson |
Subject: |
[Bug-gnulib] Re: new module: getsubopt |
Date: |
Sat, 07 Aug 2004 00:09:59 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> 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.
I know it is merely informative, but looking at the example code on
the OpenGroup web page suggest *VALUEP should be set, even if -1 is
returned, as the code appear to dereference *VALUEP in that case.
To me it seems more useful to set *VALUEP even for -1.
> I've added your patch.
Thanks,
Simon